├── .editorconfig ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .markdownlint.yaml ├── LICENSE ├── README.md ├── Taskfile.yml ├── assets ├── linter.png ├── runtime.png └── test.png ├── benchmarks ├── __main__.py ├── _cli.py ├── _core.py └── tests.yaml ├── deal ├── __init__.py ├── __main__.py ├── _cached_property.py ├── _cli │ ├── __init__.py │ ├── _base.py │ ├── _common.py │ ├── _decorate.py │ ├── _lint.py │ ├── _main.py │ ├── _memtest.py │ ├── _prove.py │ ├── _stub.py │ └── _test.py ├── _colors.py ├── _exceptions.py ├── _imports.py ├── _mem_test.py ├── _runtime │ ├── __init__.py │ ├── _contracts.py │ ├── _decorators.py │ ├── _dispatch.py │ ├── _has_patcher.py │ ├── _inherit.py │ ├── _invariant.py │ └── _validators.py ├── _schemes.py ├── _source.py ├── _sphinx.py ├── _state.py ├── _testing.py ├── _trace.py ├── _types.py ├── introspection │ ├── __init__.py │ ├── _extractor.py │ └── _wrappers.py ├── linter │ ├── __init__.py │ ├── __main__.py │ ├── _checker.py │ ├── _contract.py │ ├── _error.py │ ├── _extractors │ │ ├── __init__.py │ │ ├── asserts.py │ │ ├── common.py │ │ ├── contracts.py │ │ ├── definitions.py │ │ ├── examples.py │ │ ├── exceptions.py │ │ ├── imports.py │ │ ├── markers.py │ │ ├── pre.py │ │ ├── result.py │ │ ├── returns.py │ │ └── value.py │ ├── _func.py │ ├── _rules.py │ ├── _stub.py │ ├── _template.py │ ├── _transformer.py │ └── stubs │ │ ├── aiohttp │ │ ├── base_protocol.json │ │ ├── client.json │ │ ├── client_reqrep.json │ │ ├── client_ws.json │ │ ├── connector.json │ │ ├── cookiejar.json │ │ ├── formdata.json │ │ ├── helpers.json │ │ ├── http_parser.json │ │ ├── http_websocket.json │ │ ├── http_writer.json │ │ ├── locks.json │ │ ├── multipart.json │ │ ├── payload.json │ │ ├── pytest_plugin.json │ │ ├── resolver.json │ │ ├── streams.json │ │ ├── test_utils.json │ │ ├── web.json │ │ ├── web_app.json │ │ ├── web_exceptions.json │ │ ├── web_fileresponse.json │ │ ├── web_log.json │ │ ├── web_middlewares.json │ │ ├── web_protocol.json │ │ ├── web_request.json │ │ ├── web_response.json │ │ ├── web_runner.json │ │ ├── web_server.json │ │ ├── web_urldispatcher.json │ │ ├── web_ws.json │ │ └── worker.json │ │ ├── cpython │ │ ├── aifc.json │ │ ├── antigravity.json │ │ ├── argparse.json │ │ ├── ast.json │ │ ├── asynchat.json │ │ ├── asyncio │ │ │ ├── __main__.json │ │ │ ├── base_events.json │ │ │ ├── base_subprocess.json │ │ │ ├── base_tasks.json │ │ │ ├── coroutines.json │ │ │ ├── events.json │ │ │ ├── futures.json │ │ │ ├── locks.json │ │ │ ├── proactor_events.json │ │ │ ├── queues.json │ │ │ ├── runners.json │ │ │ ├── selector_events.json │ │ │ ├── sslproto.json │ │ │ ├── staggered.json │ │ │ ├── streams.json │ │ │ ├── subprocess.json │ │ │ ├── tasks.json │ │ │ ├── transports.json │ │ │ ├── trsock.json │ │ │ ├── unix_events.json │ │ │ ├── windows_events.json │ │ │ └── windows_utils.json │ │ ├── asyncore.json │ │ ├── base64.json │ │ ├── bdb.json │ │ ├── binhex.json │ │ ├── bisect.json │ │ ├── bz2.json │ │ ├── cProfile.json │ │ ├── calendar.json │ │ ├── cgi.json │ │ ├── cgitb.json │ │ ├── chunk.json │ │ ├── cmd.json │ │ ├── code.json │ │ ├── codecs.json │ │ ├── codeop.json │ │ ├── colorsys.json │ │ ├── compileall.json │ │ ├── configparser.json │ │ ├── contextlib.json │ │ ├── copy.json │ │ ├── copyreg.json │ │ ├── crypt.json │ │ ├── csv.json │ │ ├── dataclasses.json │ │ ├── datetime.json │ │ ├── difflib.json │ │ ├── dis.json │ │ ├── doctest.json │ │ ├── enum.json │ │ ├── filecmp.json │ │ ├── fileinput.json │ │ ├── fnmatch.json │ │ ├── formatter.json │ │ ├── fractions.json │ │ ├── ftplib.json │ │ ├── functools.json │ │ ├── genericpath.json │ │ ├── getopt.json │ │ ├── getpass.json │ │ ├── gettext.json │ │ ├── glob.json │ │ ├── graphlib.json │ │ ├── gzip.json │ │ ├── hashlib.json │ │ ├── hmac.json │ │ ├── http │ │ │ ├── client.json │ │ │ ├── cookiejar.json │ │ │ ├── cookies.json │ │ │ └── server.json │ │ ├── imaplib.json │ │ ├── imghdr.json │ │ ├── imp.json │ │ ├── inspect.json │ │ ├── ipaddress.json │ │ ├── keyword.json │ │ ├── linecache.json │ │ ├── locale.json │ │ ├── lzma.json │ │ ├── macpath.json │ │ ├── mailbox.json │ │ ├── mailcap.json │ │ ├── mimetypes.json │ │ ├── modulefinder.json │ │ ├── netrc.json │ │ ├── nntplib.json │ │ ├── ntpath.json │ │ ├── nturl2path.json │ │ ├── numbers.json │ │ ├── operator.json │ │ ├── optparse.json │ │ ├── os.json │ │ ├── pathlib.json │ │ ├── pdb.json │ │ ├── pickle.json │ │ ├── pickletools.json │ │ ├── pipes.json │ │ ├── pkgutil.json │ │ ├── platform.json │ │ ├── plistlib.json │ │ ├── poplib.json │ │ ├── posixpath.json │ │ ├── pprint.json │ │ ├── profile.json │ │ ├── pstats.json │ │ ├── pty.json │ │ ├── py_compile.json │ │ ├── pyclbr.json │ │ ├── pydoc.json │ │ ├── queue.json │ │ ├── quopri.json │ │ ├── random.json │ │ ├── re.json │ │ ├── rlcompleter.json │ │ ├── runpy.json │ │ ├── secrets.json │ │ ├── selectors.json │ │ ├── shelve.json │ │ ├── shlex.json │ │ ├── shutil.json │ │ ├── site.json │ │ ├── smtpd.json │ │ ├── smtplib.json │ │ ├── sndhdr.json │ │ ├── socket.json │ │ ├── socketserver.json │ │ ├── sre_compile.json │ │ ├── sre_parse.json │ │ ├── ssl.json │ │ ├── statistics.json │ │ ├── string.json │ │ ├── subprocess.json │ │ ├── sunau.json │ │ ├── symbol.json │ │ ├── symtable.json │ │ ├── sysconfig.json │ │ ├── tabnanny.json │ │ ├── tarfile.json │ │ ├── telnetlib.json │ │ ├── tempfile.json │ │ ├── textwrap.json │ │ ├── threading.json │ │ ├── timeit.json │ │ ├── token.json │ │ ├── tokenize.json │ │ ├── trace.json │ │ ├── traceback.json │ │ ├── tracemalloc.json │ │ ├── turtle.json │ │ ├── types.json │ │ ├── typing.json │ │ ├── urllib │ │ │ ├── parse.json │ │ │ ├── request.json │ │ │ ├── response.json │ │ │ └── robotparser.json │ │ ├── uu.json │ │ ├── uuid.json │ │ ├── warnings.json │ │ ├── wave.json │ │ ├── weakref.json │ │ ├── webbrowser.json │ │ ├── xdrlib.json │ │ ├── zipapp.json │ │ ├── zipfile.json │ │ └── zipimport.json │ │ ├── dateutil │ │ ├── easter.json │ │ ├── parser │ │ │ ├── _parser.json │ │ │ └── isoparser.json │ │ ├── relativedelta.json │ │ ├── rrule.json │ │ ├── tz │ │ │ ├── _common.json │ │ │ ├── tz.json │ │ │ └── win.json │ │ └── zoneinfo │ │ │ └── __init__.json │ │ ├── marshmallow │ │ ├── base.json │ │ ├── class_registry.json │ │ ├── fields.json │ │ ├── orderedset.json │ │ ├── schema.json │ │ ├── utils.json │ │ └── validate.json │ │ ├── numpy │ │ ├── _globals.json │ │ ├── _pytesttester.json │ │ ├── _version.json │ │ ├── array_api │ │ │ ├── _array_object.json │ │ │ ├── _creation_functions.json │ │ │ ├── _data_type_functions.json │ │ │ ├── _dtypes.json │ │ │ ├── _elementwise_functions.json │ │ │ ├── _statistical_functions.json │ │ │ ├── linalg.json │ │ │ └── setup.json │ │ ├── conftest.json │ │ ├── core │ │ │ ├── __init__.json │ │ │ ├── _asarray.json │ │ │ ├── _dtype.json │ │ │ ├── _dtype_ctypes.json │ │ │ ├── _exceptions.json │ │ │ ├── _internal.json │ │ │ ├── _machar.json │ │ │ ├── _methods.json │ │ │ ├── _type_aliases.json │ │ │ ├── _ufunc_config.json │ │ │ ├── arrayprint.json │ │ │ ├── defchararray.json │ │ │ ├── einsumfunc.json │ │ │ ├── fromnumeric.json │ │ │ ├── function_base.json │ │ │ ├── getlimits.json │ │ │ ├── memmap.json │ │ │ ├── numeric.json │ │ │ ├── numerictypes.json │ │ │ ├── overrides.json │ │ │ ├── records.json │ │ │ ├── setup.json │ │ │ ├── setup_common.json │ │ │ └── shape_base.json │ │ ├── ctypeslib.json │ │ ├── dual.json │ │ ├── lib │ │ │ ├── _datasource.json │ │ │ ├── _iotools.json │ │ │ ├── _version.json │ │ │ ├── arraypad.json │ │ │ ├── arraysetops.json │ │ │ ├── arrayterator.json │ │ │ ├── format.json │ │ │ ├── function_base.json │ │ │ ├── histograms.json │ │ │ ├── index_tricks.json │ │ │ ├── nanfunctions.json │ │ │ ├── npyio.json │ │ │ ├── polynomial.json │ │ │ ├── recfunctions.json │ │ │ ├── setup.json │ │ │ ├── shape_base.json │ │ │ ├── stride_tricks.json │ │ │ ├── twodim_base.json │ │ │ ├── type_check.json │ │ │ ├── ufunclike.json │ │ │ ├── user_array.json │ │ │ └── utils.json │ │ ├── linalg │ │ │ ├── linalg.json │ │ │ └── setup.json │ │ ├── ma │ │ │ ├── bench.json │ │ │ ├── core.json │ │ │ ├── extras.json │ │ │ ├── mrecords.json │ │ │ ├── setup.json │ │ │ ├── testutils.json │ │ │ └── timer_comparison.json │ │ ├── polynomial │ │ │ ├── __init__.json │ │ │ ├── _polybase.json │ │ │ ├── chebyshev.json │ │ │ ├── hermite.json │ │ │ ├── hermite_e.json │ │ │ ├── laguerre.json │ │ │ ├── legendre.json │ │ │ ├── polynomial.json │ │ │ ├── polyutils.json │ │ │ └── setup.json │ │ └── setup.json │ │ ├── pytz │ │ ├── __init__.json │ │ ├── reference.json │ │ ├── tzfile.json │ │ └── tzinfo.json │ │ ├── requests │ │ ├── __init__.json │ │ ├── _internal_utils.json │ │ ├── adapters.json │ │ ├── auth.json │ │ ├── cookies.json │ │ ├── help.json │ │ ├── models.json │ │ ├── sessions.json │ │ ├── status_codes.json │ │ └── utils.json │ │ └── urllib3 │ │ ├── __init__.json │ │ ├── _collections.json │ │ ├── connection.json │ │ ├── connectionpool.json │ │ ├── contrib │ │ ├── appengine.json │ │ ├── ntlmpool.json │ │ ├── pyopenssl.json │ │ ├── securetransport.json │ │ └── socks.json │ │ ├── fields.json │ │ ├── poolmanager.json │ │ ├── request.json │ │ ├── response.json │ │ └── util │ │ ├── connection.json │ │ ├── request.json │ │ ├── response.json │ │ ├── retry.json │ │ ├── ssl_.json │ │ ├── timeout.json │ │ └── wait.json ├── mypy.py └── py.typed ├── docs ├── basic │ ├── crosshair.md │ ├── exceptions.md │ ├── intro.md │ ├── linter.md │ ├── motivation.md │ ├── refs.md │ ├── runtime.md │ ├── side-effects.md │ ├── tests.md │ ├── values.md │ └── verification.md ├── conf.py ├── details │ ├── api.md │ ├── cli.md │ ├── contracts.md │ ├── dispatch.md │ ├── docs.md │ ├── examples.md │ ├── module_load.md │ ├── recipes.md │ ├── stubs.md │ └── tests.md ├── index.md └── requirements.txt ├── examples ├── __init__.py ├── choice.py ├── concat.py ├── count.py ├── div.py ├── format.py ├── fuzzing_atheris.py ├── fuzzing_pythonfuzz.py ├── index_of.py ├── min.py ├── sphinx.py └── using_hypothesis.py ├── logo.png ├── logo.svg ├── pyproject.toml ├── setup.cfg ├── tests ├── __init__.py ├── test_aliases.py ├── test_chain.py ├── test_cli │ ├── __init__.py │ ├── test_common.py │ ├── test_decorate.py │ ├── test_lint.py │ ├── test_main.py │ ├── test_mem_test.py │ ├── test_prove.py │ ├── test_stub.py │ └── test_test.py ├── test_docs.py ├── test_doctest.py ├── test_exceptions.py ├── test_imports.py ├── test_introspection.py ├── test_linter │ ├── __init__.py │ ├── helpers.py │ ├── test_checker.py │ ├── test_contract.py │ ├── test_error.py │ ├── test_extractors │ │ ├── __init__.py │ │ ├── test_asserts.py │ │ ├── test_common.py │ │ ├── test_contracts.py │ │ ├── test_definitions.py │ │ ├── test_examples.py │ │ ├── test_exceptions.py │ │ ├── test_exceptions_stubs.py │ │ ├── test_imports.py │ │ ├── test_markers.py │ │ ├── test_pre.py │ │ ├── test_result.py │ │ └── test_returns.py │ ├── test_func.py │ ├── test_main.py │ ├── test_rules.py │ ├── test_stub.py │ └── test_transformer.py ├── test_main.py ├── test_mem_test.py ├── test_runtime │ ├── __init__.py │ ├── helpers.py │ ├── test_dispatch.py │ ├── test_ensure.py │ ├── test_example.py │ ├── test_has.py │ ├── test_inherit.py │ ├── test_inv.py │ ├── test_offline.py │ ├── test_post.py │ ├── test_pre.py │ ├── test_pure.py │ ├── test_raises.py │ ├── test_reason.py │ ├── test_safe.py │ ├── test_silent.py │ └── test_validators.py ├── test_schemes.py ├── test_source.py ├── test_sphinx.py ├── test_state.py ├── test_testing.py └── test_trace.py └── types ├── types_dispatch.py ├── types_ensure.py ├── types_has.py ├── types_inherit.py ├── types_inv.py ├── types_post.py ├── types_pre.py └── types_reason.py /.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | # EditorConfig helps developers define and maintain consistent 3 | # coding styles between different editors and IDEs 4 | # https://editorconfig.org 5 | root = true 6 | 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | 13 | [*.py] 14 | indent_style = space 15 | indent_size = 4 16 | 17 | [*.{md,rst,txt}] 18 | indent_style = space 19 | indent_size = 4 20 | 21 | [*.{json,yml,yaml}] 22 | indent_style = space 23 | indent_size = 2 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # python 2 | *.pyc 3 | __pycache__/ 4 | *.egg-info/ 5 | dist/ 6 | /venvs/ 7 | /.venvs/ 8 | .venv 9 | .venvs 10 | venv/ 11 | 12 | # coverage 13 | .coverage 14 | .coverage.* 15 | coverage.xml 16 | htmlcov/ 17 | 18 | # profiling 19 | /callgraph.svg 20 | /profile.svg 21 | /profile.pstats 22 | /*.lprof 23 | 24 | # other 25 | README.rst 26 | docs/build/ 27 | /setup.py 28 | .dephell_report/ 29 | .mypy_cache/ 30 | .pytype/ 31 | .pytest_cache/ 32 | /tmp.py 33 | .hypothesis/ 34 | .task/ 35 | poetry.lock 36 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml 2 | default: true # enable all by default 3 | MD007: # unordered list indentation 4 | indent: 2 5 | MD013: false # do not validate line length 6 | MD014: false # allow $ before command output 7 | MD029: # ordered list prefix 8 | style: "one" 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Gram 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/linter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/assets/linter.png -------------------------------------------------------------------------------- /assets/runtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/assets/runtime.png -------------------------------------------------------------------------------- /assets/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/assets/test.png -------------------------------------------------------------------------------- /benchmarks/__main__.py: -------------------------------------------------------------------------------- 1 | from ._cli import main 2 | 3 | 4 | main() 5 | -------------------------------------------------------------------------------- /benchmarks/_cli.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import yaml 4 | 5 | from ._core import run_test 6 | 7 | 8 | def main(): 9 | path = Path(__file__).parent / 'tests.yaml' 10 | for group in yaml.safe_load(path.read_text()): 11 | print(group['name']) 12 | for item in group['items']: 13 | run_test(**item) 14 | -------------------------------------------------------------------------------- /deal/__main__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from ._cli import main 4 | 5 | 6 | sys.exit(main(sys.argv[1:])) 7 | -------------------------------------------------------------------------------- /deal/_cached_property.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Any, Callable, Generic, TypeVar, overload 4 | 5 | 6 | T = TypeVar('T') 7 | 8 | 9 | class cached_property(Generic[T]): # noqa: N801 10 | def __init__(self, func: Callable[[Any], T]) -> None: 11 | self.func = func 12 | 13 | @overload 14 | def __get__(self, instance: None, owner: type | None = ...) -> cached_property[T]: 15 | pass 16 | 17 | @overload 18 | def __get__(self, instance, owner: type | None = ...) -> T: 19 | pass 20 | 21 | def __get__(self, obj, cls): 22 | value = self.func(obj) 23 | obj.__dict__[self.func.__name__] = value 24 | return value 25 | -------------------------------------------------------------------------------- /deal/_cli/__init__.py: -------------------------------------------------------------------------------- 1 | from ._main import main 2 | 3 | 4 | __all__ = ['main'] 5 | -------------------------------------------------------------------------------- /deal/_cli/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from argparse import ArgumentParser, Namespace 4 | from pathlib import Path 5 | from typing import TextIO 6 | 7 | 8 | class Command: 9 | stream: TextIO 10 | root: Path 11 | 12 | def __init__(self, stream: TextIO, root: Path) -> None: 13 | self.stream = stream 14 | self.root = root 15 | 16 | def print(self, *args) -> None: 17 | print(*args, file=self.stream) 18 | 19 | @staticmethod 20 | def init_parser(parser: ArgumentParser) -> None: 21 | raise NotImplementedError 22 | 23 | def __call__(self, args: Namespace) -> int: 24 | raise NotImplementedError 25 | -------------------------------------------------------------------------------- /deal/_cli/_common.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from pathlib import Path 4 | from typing import Iterator 5 | 6 | 7 | def get_paths(path: Path) -> Iterator[Path]: 8 | """Recursively yields python files. 9 | """ 10 | if not path.exists(): 11 | raise FileNotFoundError(str(path)) 12 | if path.is_file(): 13 | if path.suffix == '.py': 14 | yield path 15 | return 16 | for subpath in path.iterdir(): 17 | if subpath.name[0] == '.': 18 | continue 19 | if subpath.name == '__pycache__': 20 | continue 21 | yield from get_paths(subpath) 22 | -------------------------------------------------------------------------------- /deal/_colors.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from ._state import state 4 | 5 | 6 | try: 7 | import pygments 8 | except ImportError: 9 | pygments = None 10 | else: 11 | from pygments.formatters import TerminalFormatter 12 | from pygments.lexers import PythonLexer 13 | 14 | 15 | COLORS = dict( 16 | red='\033[91m', 17 | green='\033[92m', 18 | yellow='\033[93m', 19 | blue='\033[94m', 20 | magenta='\033[95m', 21 | end='\033[0m', 22 | ) 23 | NOCOLORS = dict( 24 | red='', 25 | green='', 26 | yellow='', 27 | blue='', 28 | magenta='', 29 | end='', 30 | ) 31 | 32 | 33 | def highlight(source: str) -> str: 34 | if pygments is None: # pragma: no cover 35 | return source 36 | source = pygments.highlight( 37 | code=source, 38 | lexer=PythonLexer(), 39 | formatter=TerminalFormatter(), 40 | ) 41 | return source.rstrip() 42 | 43 | 44 | def get_colors(args) -> dict[str, str]: 45 | if not state.color: 46 | return NOCOLORS 47 | if args.nocolor: 48 | state.color = False 49 | return NOCOLORS 50 | return COLORS 51 | -------------------------------------------------------------------------------- /deal/_mem_test.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import gc 4 | import typing 5 | from collections import Counter 6 | 7 | from ._cached_property import cached_property 8 | 9 | 10 | class MemoryTracker: 11 | before: typing.Counter[str] 12 | after: typing.Counter[str] 13 | 14 | def __init__(self) -> None: 15 | self.before = Counter() 16 | self.after = Counter() 17 | 18 | def __enter__(self) -> None: 19 | self.before = self._dump() 20 | 21 | def __exit__(self, *exc) -> None: 22 | self.after = self._dump() 23 | 24 | @cached_property 25 | def diff(self) -> typing.Counter[str]: 26 | return self.after - self.before - Counter({'weakref': 1}) 27 | 28 | @staticmethod 29 | def _dump() -> typing.Counter[str]: 30 | counter: typing.Counter[str] = Counter() 31 | gc.collect() 32 | for obj in gc.get_objects(): 33 | name: str = type(obj).__qualname__ 34 | counter[name] += 1 35 | return counter 36 | -------------------------------------------------------------------------------- /deal/_runtime/__init__.py: -------------------------------------------------------------------------------- 1 | from ._contracts import Contracts 2 | from ._decorators import ( 3 | catch, chain, dispatch, ensure, example, has, implies, 4 | inherit, inv, post, pre, pure, raises, reason, safe, 5 | ) 6 | from ._dispatch import Dispatch 7 | from ._has_patcher import HasPatcher 8 | from ._inherit import Inherit 9 | from ._invariant import invariant 10 | from ._validators import InvariantValidator, RaisesValidator, ReasonValidator, Validator 11 | 12 | 13 | __all__ = [ 14 | # public decorators 15 | 'chain', 16 | 'dispatch', 17 | 'ensure', 18 | 'example', 19 | 'has', 20 | 'inherit', 21 | 'inv', 22 | 'post', 23 | 'pre', 24 | 'raises', 25 | 'reason', 26 | 27 | # public functions 28 | 'catch', 29 | 'implies', 30 | 'pure', 31 | 'safe', 32 | 33 | # private 34 | 'Contracts', 35 | 'Dispatch', 36 | 'HasPatcher', 37 | 'Inherit', 38 | 'invariant', 39 | 'InvariantValidator', 40 | 'RaisesValidator', 41 | 'ReasonValidator', 42 | 'Validator', 43 | ] 44 | -------------------------------------------------------------------------------- /deal/_schemes.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from abc import ABC, abstractmethod 4 | from typing import TYPE_CHECKING, Any 5 | 6 | 7 | if TYPE_CHECKING: 8 | import vaa 9 | 10 | 11 | class Scheme(ABC): 12 | """A base class for implementing a custom validator. 13 | 14 | The custom validator should implement `is_valid` method. 15 | The method should return True if the data is valid. 16 | Otherwise, it should set `errors` attribute and return False. 17 | """ 18 | __slots__ = ('data', 'errors') 19 | data: dict[str, Any] 20 | errors: list[vaa.Error] 21 | 22 | def __init__(self, data: dict[str, Any]) -> None: 23 | self.data = data 24 | self.errors = [] 25 | 26 | @abstractmethod 27 | def is_valid(self) -> bool: 28 | raise NotImplementedError 29 | -------------------------------------------------------------------------------- /deal/_types.py: -------------------------------------------------------------------------------- 1 | from typing import Type, Union 2 | 3 | 4 | ExceptionType = Union[Exception, Type[Exception]] 5 | -------------------------------------------------------------------------------- /deal/introspection/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | The module provides `get_contracts` function which enumerates 3 | contracts wrapping the given function. Every contract is returned 4 | in wrapper providing a stable interface. 5 | 6 | Usage example: 7 | 8 | ```python 9 | import deal 10 | 11 | @deal.pre(lambda x: x > 0) 12 | def f(x): 13 | return x + 1 14 | 15 | contracts = deal.introspection.get_contracts(f) 16 | for contract in contracts: 17 | assert isinstance(contract, deal.introspection.Contract) 18 | assert isinstance(contract, deal.introspection.Pre) 19 | assert contract.source == 'x > 0' 20 | assert contract.exception is deal.PreContractError 21 | contract.validate(1) 22 | ``` 23 | """ 24 | 25 | from ._extractor import get_contracts, init_all, unwrap 26 | from ._wrappers import ( 27 | Contract, Ensure, Example, Has, Post, Pre, Raises, Reason, ValidatedContract, 28 | ) 29 | 30 | 31 | __all__ = [ 32 | # functions 33 | 'get_contracts', 34 | 'init_all', 35 | 'unwrap', 36 | 37 | # wrappers 38 | 'Contract', 39 | 'Ensure', 40 | 'Example', 41 | 'Has', 42 | 'Post', 43 | 'Pre', 44 | 'Raises', 45 | 'Reason', 46 | 'ValidatedContract', 47 | ] 48 | -------------------------------------------------------------------------------- /deal/linter/__init__.py: -------------------------------------------------------------------------------- 1 | from ._checker import Checker 2 | from ._stub import StubsManager, generate_stub 3 | from ._transformer import TransformationType, Transformer 4 | 5 | 6 | __all__ = [ 7 | 'Checker', 8 | 'generate_stub', 9 | 'StubsManager', 10 | 'TransformationType', 11 | 'Transformer', 12 | ] 13 | -------------------------------------------------------------------------------- /deal/linter/__main__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from .._cli import main 4 | 5 | 6 | sys.exit(main(['lint'] + sys.argv[1:])) 7 | -------------------------------------------------------------------------------- /deal/linter/_error.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Iterator 4 | 5 | 6 | ERROR_FORMAT = 'DEL{code:03d}' 7 | 8 | 9 | class Error: 10 | __slots__ = ('row', 'col', 'code', 'text', 'value') 11 | 12 | def __init__( 13 | self, *, 14 | row: int, 15 | col: int, 16 | code: int, 17 | text: str, 18 | value: str | None = None, 19 | ) -> None: 20 | self.row = row 21 | self.col = col 22 | self.code = code 23 | self.text = text 24 | self.value = value 25 | 26 | @property 27 | def full_code(self) -> str: 28 | return ERROR_FORMAT.format(code=self.code) 29 | 30 | @property 31 | def message(self) -> str: 32 | msg = self.full_code + ' ' + self.text 33 | if self.value: 34 | msg += f' ({self.value})' 35 | return msg 36 | 37 | def __iter__(self) -> Iterator[int | str]: 38 | yield self.row 39 | yield self.col 40 | yield self.message 41 | 42 | def __str__(self) -> str: 43 | return self.message 44 | 45 | def __repr__(self) -> str: 46 | name = type(self).__name__ 47 | return f'{name}(row={self.row}, col={self.col}, code={self.code})' 48 | 49 | def __hash__(self) -> int: 50 | return hash((self.row, self.col, self.code)) 51 | -------------------------------------------------------------------------------- /deal/linter/_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | from .asserts import get_asserts 2 | from .common import TOKENS, get_name 3 | from .contracts import get_contracts 4 | from .definitions import get_definitions 5 | from .examples import get_example 6 | from .exceptions import get_exceptions 7 | from .imports import get_imports 8 | from .markers import get_markers 9 | from .pre import get_pre 10 | from .result import uses_result 11 | from .returns import get_returns, has_returns 12 | from .value import UNKNOWN, get_value 13 | 14 | 15 | __all__ = [ 16 | 'get_asserts', 17 | 'get_contracts', 18 | 'get_definitions', 19 | 'get_example', 20 | 'get_exceptions', 21 | 'get_imports', 22 | 'get_markers', 23 | 'get_name', 24 | 'get_pre', 25 | 'get_returns', 26 | 'get_value', 27 | 'has_returns', 28 | 'TOKENS', 29 | 'uses_result', 30 | 'UNKNOWN', 31 | ] 32 | -------------------------------------------------------------------------------- /deal/linter/_extractors/asserts.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | from .common import TOKENS, Extractor, Token 6 | from .value import UNKNOWN, get_value 7 | 8 | 9 | if TYPE_CHECKING: 10 | import ast 11 | 12 | import astroid 13 | 14 | 15 | get_asserts = Extractor() 16 | 17 | 18 | @get_asserts.register(*TOKENS.ASSERT) 19 | def handle_assert(expr: ast.Assert | astroid.Assert) -> Token | None: 20 | value = get_value(expr=expr.test, allow_inference=False) 21 | if value is UNKNOWN: 22 | return None 23 | if value: 24 | return None 25 | return Token(value=value, line=expr.lineno, col=expr.col_offset + 7) 26 | -------------------------------------------------------------------------------- /deal/linter/_extractors/imports.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import ast 4 | 5 | from .common import Extractor, Token 6 | 7 | 8 | try: 9 | import astroid 10 | except ImportError: 11 | pass 12 | 13 | 14 | get_imports = Extractor() 15 | 16 | 17 | @get_imports.register(lambda: astroid.ImportFrom) 18 | def handle_astroid(expr: astroid.ImportFrom) -> Token: 19 | dots = '.' * (expr.level or 0) 20 | name = expr.modname or '' 21 | return Token(value=dots + name, line=expr.lineno, col=expr.col_offset) 22 | 23 | 24 | @get_imports.register(ast.ImportFrom) 25 | def handle_ast(expr: ast.ImportFrom) -> Token: 26 | dots = '.' * expr.level 27 | name = expr.module or '' 28 | return Token(value=dots + name, line=expr.lineno, col=expr.col_offset) 29 | -------------------------------------------------------------------------------- /deal/linter/_extractors/returns.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING, Union 4 | 5 | from .common import TOKENS, Extractor, Token, traverse 6 | from .value import UNKNOWN, get_value 7 | 8 | 9 | if TYPE_CHECKING: 10 | import ast 11 | 12 | import astroid 13 | 14 | 15 | get_returns = Extractor() 16 | 17 | 18 | def has_returns(body: list) -> bool: 19 | expected = TOKENS.RETURN + TOKENS.YIELD + TOKENS.YIELD_FROM + TOKENS.RAISE 20 | for expr in traverse(body=body): 21 | if isinstance(expr, expected): 22 | return True 23 | return False 24 | 25 | 26 | @get_returns.register(*TOKENS.RETURN) 27 | def handle_return(expr: Union[ast.Return, astroid.Return]) -> Token | None: 28 | if expr.value is None: 29 | return Token(value=None, line=expr.lineno, col=expr.col_offset) 30 | value = get_value(expr=expr.value) 31 | if value is UNKNOWN: 32 | return None 33 | return Token(value=value, line=expr.lineno, col=expr.value.col_offset) 34 | 35 | 36 | @get_returns.register(*TOKENS.YIELD) 37 | def handle_yield(expr: Union[ast.Yield, astroid.Yield]) -> Token | None: 38 | if expr.value is None: 39 | return Token(value=None, line=expr.lineno, col=expr.col_offset) 40 | value = get_value(expr=expr.value) 41 | if value is UNKNOWN: 42 | return None 43 | return Token(value=value, line=expr.lineno, col=expr.value.col_offset) 44 | -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/base_protocol.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseProtocol._drain_helper": { 3 | "raises": [ 4 | "AssertionError", 5 | "ConnectionResetError" 6 | ] 7 | }, 8 | "BaseProtocol.pause_writing": { 9 | "raises": [ 10 | "AssertionError" 11 | ] 12 | }, 13 | "BaseProtocol.resume_writing": { 14 | "raises": [ 15 | "AssertionError" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/client.json: -------------------------------------------------------------------------------- 1 | { 2 | "ClientSession.__init__": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "ClientSession.__init_subclass__": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "ClientSession._request": { 13 | "raises": [ 14 | "InvalidURL", 15 | "RuntimeError", 16 | "TypeError", 17 | "ValueError" 18 | ] 19 | }, 20 | "ClientSession._ws_connect": { 21 | "has": [ 22 | "import" 23 | ], 24 | "raises": [ 25 | "AssertionError", 26 | "RuntimeError", 27 | "TypeError", 28 | "ValueError", 29 | "message" 30 | ] 31 | }, 32 | "_SessionRequestContextManager.__aexit__": { 33 | "raises": [ 34 | "AssertionError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/client_ws.json: -------------------------------------------------------------------------------- 1 | { 2 | "ClientWebSocketResponse.__anext__": { 3 | "raises": [ 4 | "StopAsyncIteration" 5 | ] 6 | }, 7 | "ClientWebSocketResponse.__init__": { 8 | "raises": [ 9 | "ZeroDivisionError" 10 | ] 11 | }, 12 | "ClientWebSocketResponse.receive_bytes": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "ClientWebSocketResponse.receive_str": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "ClientWebSocketResponse.send_bytes": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | }, 27 | "ClientWebSocketResponse.send_str": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/cookiejar.json: -------------------------------------------------------------------------------- 1 | { 2 | "CookieJar.__init__": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "CookieJar._do_expiration": { 8 | "has": [ 9 | "time" 10 | ] 11 | }, 12 | "CookieJar._parse_date": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "CookieJar.clear": { 18 | "has": [ 19 | "time" 20 | ] 21 | }, 22 | "CookieJar.clear_domain": { 23 | "has": [ 24 | "time" 25 | ] 26 | }, 27 | "CookieJar.filter_cookies": { 28 | "has": [ 29 | "import" 30 | ], 31 | "raises": [ 32 | "RuntimeError", 33 | "TypeError", 34 | "message" 35 | ] 36 | }, 37 | "CookieJar.save": { 38 | "has": [ 39 | "write" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/formdata.json: -------------------------------------------------------------------------------- 1 | { 2 | "FormData._gen_form_data": { 3 | "raises": [ 4 | "AssertionError", 5 | "RuntimeError", 6 | "TypeError" 7 | ] 8 | }, 9 | "FormData.add_field": { 10 | "raises": [ 11 | "TypeError" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/http_parser.json: -------------------------------------------------------------------------------- 1 | { 2 | "DeflateBuffer.__init__": { 3 | "raises": [ 4 | "ContentEncodingError" 5 | ] 6 | }, 7 | "DeflateBuffer.feed_data": { 8 | "raises": [ 9 | "ContentEncodingError" 10 | ] 11 | }, 12 | "DeflateBuffer.feed_eof": { 13 | "raises": [ 14 | "ContentEncodingError" 15 | ] 16 | }, 17 | "HttpPayloadParser.feed_eof": { 18 | "raises": [ 19 | "ContentLengthError", 20 | "TransferEncodingError" 21 | ] 22 | }, 23 | "HttpRequestParser.parse_message": { 24 | "raises": [ 25 | "BadStatusLine", 26 | "LineTooLong" 27 | ] 28 | }, 29 | "HttpResponseParser.parse_message": { 30 | "raises": [ 31 | "BadStatusLine", 32 | "LineTooLong" 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/http_websocket.json: -------------------------------------------------------------------------------- 1 | { 2 | "WSMessage.json": { 3 | "raises": [ 4 | "JSONDecodeError", 5 | "TypeError" 6 | ] 7 | }, 8 | "WebSocketReader._feed_data": { 9 | "raises": [ 10 | "AssertionError", 11 | "WebSocketError" 12 | ] 13 | }, 14 | "WebSocketWriter._send_frame": { 15 | "raises": [ 16 | "AssertionError", 17 | "ConnectionResetError" 18 | ] 19 | }, 20 | "WebSocketWriter._write": { 21 | "raises": [ 22 | "ConnectionResetError" 23 | ] 24 | }, 25 | "_websocket_mask_python": { 26 | "raises": [ 27 | "AssertionError" 28 | ] 29 | }, 30 | "ws_ext_gen": { 31 | "raises": [ 32 | "ValueError" 33 | ] 34 | }, 35 | "ws_ext_parse": { 36 | "raises": [ 37 | "WSHandshakeError" 38 | ] 39 | } 40 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/http_writer.json: -------------------------------------------------------------------------------- 1 | { 2 | "StreamWriter._write": { 3 | "raises": [ 4 | "ConnectionResetError" 5 | ] 6 | }, 7 | "_safe_header": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/locks.json: -------------------------------------------------------------------------------- 1 | { 2 | "EventResultOrError.wait": { 3 | "raises": [ 4 | "self._exc" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "AsyncIterablePayload.__init__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "BytesPayload.__init__": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "message" 15 | ] 16 | }, 17 | "Payload.__init__": { 18 | "raises": [ 19 | "AssertionError" 20 | ] 21 | }, 22 | "PayloadRegistry.get": { 23 | "raises": [ 24 | "LookupError" 25 | ] 26 | }, 27 | "PayloadRegistry.register": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/pytest_plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "_runtime_warning_context": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "loop": { 8 | "has": [ 9 | "global" 10 | ], 11 | "raises": [ 12 | "AssertionError" 13 | ] 14 | }, 15 | "proactor_loop": { 16 | "has": [ 17 | "global" 18 | ], 19 | "raises": [ 20 | "AssertionError" 21 | ] 22 | }, 23 | "pytest_generate_tests": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/resolver.json: -------------------------------------------------------------------------------- 1 | { 2 | "AsyncResolver.__init__": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "AsyncResolver.resolve": { 8 | "raises": [ 9 | "OSError" 10 | ] 11 | }, 12 | "ThreadedResolver.__init__": { 13 | "raises": [ 14 | "RuntimeError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/test_utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "AioHTTPTestCase.get_app": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "BaseTestServer.close": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "BaseTestServer.handler": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "BaseTestServer.make_url": { 18 | "raises": [ 19 | "AssertionError" 20 | ] 21 | }, 22 | "BaseTestServer.start_server": { 23 | "has": [ 24 | "network" 25 | ], 26 | "raises": [ 27 | "AssertionError" 28 | ] 29 | }, 30 | "TestClient.__init__": { 31 | "raises": [ 32 | "TypeError" 33 | ] 34 | }, 35 | "get_port_socket": { 36 | "has": [ 37 | "network" 38 | ] 39 | }, 40 | "get_unused_port_socket": { 41 | "has": [ 42 | "network" 43 | ] 44 | }, 45 | "setup_test_loop": { 46 | "has": [ 47 | "global", 48 | "import" 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web.json: -------------------------------------------------------------------------------- 1 | { 2 | "_cancel_tasks": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "Application.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "Application.__init_subclass__": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "Application._add_subapp": { 18 | "raises": [ 19 | "RuntimeError" 20 | ] 21 | }, 22 | "Application._check_frozen": { 23 | "raises": [ 24 | "RuntimeError" 25 | ] 26 | }, 27 | "Application._handle": { 28 | "raises": [ 29 | "AssertionError" 30 | ] 31 | }, 32 | "Application._set_loop": { 33 | "has": [ 34 | "import" 35 | ], 36 | "raises": [ 37 | "RuntimeError", 38 | "TypeError", 39 | "message" 40 | ] 41 | }, 42 | "Application.add_domain": { 43 | "raises": [ 44 | "TypeError" 45 | ] 46 | }, 47 | "Application.add_subapp": { 48 | "raises": [ 49 | "TypeError", 50 | "ValueError" 51 | ] 52 | }, 53 | "Application.debug": { 54 | "has": [ 55 | "import" 56 | ], 57 | "raises": [ 58 | "RuntimeError", 59 | "TypeError", 60 | "message" 61 | ] 62 | }, 63 | "CleanupContext._on_cleanup": { 64 | "raises": [ 65 | "CleanupError" 66 | ] 67 | } 68 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_exceptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "HTTPException.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "HTTPMove.__init__": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_fileresponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "FileResponse._sendfile": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "FileResponse.prepare": { 8 | "has": [ 9 | "global" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_log.json: -------------------------------------------------------------------------------- 1 | { 2 | "AccessLogger._format_t": { 3 | "has": [ 4 | "time" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_middlewares.json: -------------------------------------------------------------------------------- 1 | { 2 | "middleware": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "normalize_path_middleware": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_protocol.json: -------------------------------------------------------------------------------- 1 | { 2 | "RequestHandler._handle_request": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "RequestHandler.connection_made": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "RequestHandler.data_received": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "RequestHandler.finish_response": { 18 | "raises": [ 19 | "RuntimeError" 20 | ] 21 | }, 22 | "RequestHandler.handle_error": { 23 | "raises": [ 24 | "ConnectionError" 25 | ] 26 | }, 27 | "RequestHandler.set_parser": { 28 | "raises": [ 29 | "AssertionError" 30 | ] 31 | }, 32 | "RequestHandler.start": { 33 | "raises": [ 34 | "AssertionError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseRequest.__init__": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "BaseRequest.clone": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | }, 12 | "BaseRequest.host": { 13 | "has": [ 14 | "network" 15 | ] 16 | }, 17 | "BaseRequest.http_range": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "BaseRequest.json": { 23 | "raises": [ 24 | "HTTPBadRequest" 25 | ] 26 | }, 27 | "BaseRequest.post": { 28 | "raises": [ 29 | "HTTPUnsupportedMediaType", 30 | "TypeError", 31 | "ValueError" 32 | ] 33 | }, 34 | "BaseRequest.text": { 35 | "raises": [ 36 | "HTTPUnsupportedMediaType" 37 | ] 38 | }, 39 | "Request.app": { 40 | "raises": [ 41 | "AssertionError" 42 | ] 43 | }, 44 | "Request.config_dict": { 45 | "raises": [ 46 | "AssertionError" 47 | ] 48 | }, 49 | "Request.match_info": { 50 | "raises": [ 51 | "AssertionError" 52 | ] 53 | } 54 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppRunner.__init__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "AppRunner._make_request": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | }, 12 | "BaseRunner._check_site": { 13 | "raises": [ 14 | "RuntimeError" 15 | ] 16 | }, 17 | "BaseRunner._reg_site": { 18 | "raises": [ 19 | "RuntimeError" 20 | ] 21 | }, 22 | "BaseRunner._unreg_site": { 23 | "raises": [ 24 | "RuntimeError" 25 | ] 26 | }, 27 | "BaseSite.__init__": { 28 | "raises": [ 29 | "RuntimeError" 30 | ] 31 | }, 32 | "BaseSite.stop": { 33 | "raises": [ 34 | "AssertionError" 35 | ] 36 | }, 37 | "NamedPipeSite.__init__": { 38 | "raises": [ 39 | "RuntimeError" 40 | ] 41 | }, 42 | "NamedPipeSite.start": { 43 | "raises": [ 44 | "AssertionError" 45 | ] 46 | }, 47 | "SockSite.start": { 48 | "raises": [ 49 | "AssertionError" 50 | ] 51 | }, 52 | "TCPSite.start": { 53 | "raises": [ 54 | "AssertionError" 55 | ] 56 | }, 57 | "UnixSite.start": { 58 | "raises": [ 59 | "AssertionError" 60 | ] 61 | }, 62 | "_raise_graceful_exit": { 63 | "raises": [ 64 | "GracefulExit" 65 | ] 66 | } 67 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/web_server.json: -------------------------------------------------------------------------------- 1 | { 2 | "Server.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "Server.shutdown": { 13 | "has": [ 14 | "import" 15 | ], 16 | "raises": [ 17 | "RuntimeError", 18 | "TypeError", 19 | "message" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/aiohttp/worker.json: -------------------------------------------------------------------------------- 1 | { 2 | "GunicornTokioWebWorker.init_process": { 3 | "has": [ 4 | "global", 5 | "import" 6 | ], 7 | "raises": [ 8 | "AssertionError" 9 | ] 10 | }, 11 | "GunicornUVLoopWebWorker.init_process": { 12 | "has": [ 13 | "global", 14 | "import" 15 | ], 16 | "raises": [ 17 | "AssertionError" 18 | ] 19 | }, 20 | "GunicornWebWorker._create_ssl_context": { 21 | "raises": [ 22 | "RuntimeError" 23 | ] 24 | }, 25 | "GunicornWebWorker._get_valid_log_format": { 26 | "raises": [ 27 | "ValueError" 28 | ] 29 | }, 30 | "GunicornWebWorker._run": { 31 | "raises": [ 32 | "AssertionError", 33 | "RuntimeError" 34 | ] 35 | }, 36 | "GunicornWebWorker._wait_next_notify": { 37 | "raises": [ 38 | "AssertionError" 39 | ] 40 | }, 41 | "GunicornWebWorker.handle_abort": { 42 | "raises": [ 43 | "SystemExit" 44 | ] 45 | }, 46 | "GunicornWebWorker.run": { 47 | "raises": [ 48 | "SystemExit" 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/antigravity.json: -------------------------------------------------------------------------------- 1 | { 2 | "geohash": { 3 | "has": [ 4 | "print", 5 | "stdout" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asynchat.json: -------------------------------------------------------------------------------- 1 | { 2 | "async_chat.collect_incoming_data": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "async_chat.found_terminator": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | }, 12 | "async_chat.push": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "async_chat.set_terminator": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "AsyncIOInteractiveConsole.runcode": { 3 | "has": [ 4 | "stderr" 5 | ] 6 | }, 7 | "REPLThread.run": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "AssertionError", 13 | "TypeError", 14 | "ValueError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/base_subprocess.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseSubprocessTransport.__del__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "BaseSubprocessTransport._check_proc": { 13 | "raises": [ 14 | "ProcessLookupError" 15 | ] 16 | }, 17 | "BaseSubprocessTransport._process_exited": { 18 | "raises": [ 19 | "AssertionError" 20 | ] 21 | }, 22 | "BaseSubprocessTransport._start": { 23 | "raises": [ 24 | "NotImplementedError" 25 | ] 26 | }, 27 | "BaseSubprocessTransport._try_finish": { 28 | "raises": [ 29 | "AssertionError" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/base_tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "_task_print_stack": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/coroutines.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoroWrapper.__init__": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "CoroWrapper.__repr__": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "_format_coroutine": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "coroutine": { 18 | "has": [ 19 | "import" 20 | ], 21 | "raises": [ 22 | "RuntimeError", 23 | "TypeError", 24 | "message" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/futures.json: -------------------------------------------------------------------------------- 1 | { 2 | "Future.__await__": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "Future._log_traceback": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "Future.exception": { 13 | "raises": [ 14 | "exc" 15 | ] 16 | }, 17 | "Future.get_loop": { 18 | "raises": [ 19 | "RuntimeError" 20 | ] 21 | }, 22 | "Future.result": { 23 | "raises": [ 24 | "exc", 25 | "self._exception" 26 | ] 27 | }, 28 | "Future.set_exception": { 29 | "raises": [ 30 | "TypeError" 31 | ] 32 | }, 33 | "_chain_future": { 34 | "raises": [ 35 | "TypeError" 36 | ] 37 | }, 38 | "_copy_future_state": { 39 | "raises": [ 40 | "AssertionError" 41 | ] 42 | }, 43 | "_set_concurrent_future_state": { 44 | "raises": [ 45 | "AssertionError" 46 | ] 47 | }, 48 | "wrap_future": { 49 | "raises": [ 50 | "AssertionError", 51 | "TypeError" 52 | ] 53 | } 54 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/proactor_events.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseProactorEventLoop._make_self_pipe": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "BaseProactorEventLoop.close": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | }, 12 | "_ProactorBasePipeTransport.__del__": { 13 | "has": [ 14 | "import" 15 | ], 16 | "raises": [ 17 | "RuntimeError", 18 | "TypeError", 19 | "message" 20 | ] 21 | }, 22 | "_ProactorBaseWritePipeTransport._make_empty_waiter": { 23 | "raises": [ 24 | "RuntimeError" 25 | ] 26 | }, 27 | "_ProactorBaseWritePipeTransport.write": { 28 | "raises": [ 29 | "AssertionError", 30 | "RuntimeError", 31 | "TypeError" 32 | ] 33 | }, 34 | "_ProactorDatagramTransport.sendto": { 35 | "raises": [ 36 | "TypeError", 37 | "ValueError" 38 | ] 39 | }, 40 | "_ProactorDuplexPipeTransport.write_eof": { 41 | "raises": [ 42 | "NotImplementedError" 43 | ] 44 | }, 45 | "_ProactorReadPipeTransport._data_received": { 46 | "raises": [ 47 | "AssertionError" 48 | ] 49 | }, 50 | "_ProactorWritePipeTransport._pipe_closed": { 51 | "raises": [ 52 | "AssertionError" 53 | ] 54 | } 55 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/queues.json: -------------------------------------------------------------------------------- 1 | { 2 | "Queue.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "Queue.get_nowait": { 13 | "raises": [ 14 | "QueueEmpty" 15 | ] 16 | }, 17 | "Queue.put_nowait": { 18 | "raises": [ 19 | "QueueFull" 20 | ] 21 | }, 22 | "Queue.task_done": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/runners.json: -------------------------------------------------------------------------------- 1 | { 2 | "run": { 3 | "raises": [ 4 | "RuntimeError", 5 | "ValueError" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/sslproto.json: -------------------------------------------------------------------------------- 1 | { 2 | "SSLProtocol.__init__": { 3 | "raises": [ 4 | "RuntimeError", 5 | "ValueError" 6 | ] 7 | }, 8 | "_SSLPipe.do_handshake": { 9 | "raises": [ 10 | "AssertionError", 11 | "RuntimeError" 12 | ] 13 | }, 14 | "_SSLPipe.feed_appdata": { 15 | "raises": [ 16 | "AssertionError" 17 | ] 18 | }, 19 | "_SSLPipe.feed_eof": { 20 | "raises": [ 21 | "AssertionError" 22 | ] 23 | }, 24 | "_SSLPipe.shutdown": { 25 | "raises": [ 26 | "AssertionError", 27 | "RuntimeError" 28 | ] 29 | }, 30 | "_SSLProtocolTransport.__del__": { 31 | "has": [ 32 | "import" 33 | ], 34 | "raises": [ 35 | "RuntimeError", 36 | "TypeError", 37 | "message" 38 | ] 39 | }, 40 | "_SSLProtocolTransport.is_reading": { 41 | "raises": [ 42 | "RuntimeError" 43 | ] 44 | }, 45 | "_SSLProtocolTransport.write": { 46 | "raises": [ 47 | "TypeError" 48 | ] 49 | }, 50 | "_create_transport_context": { 51 | "raises": [ 52 | "TypeError", 53 | "ValueError" 54 | ] 55 | } 56 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/staggered.json: -------------------------------------------------------------------------------- 1 | { 2 | "staggered_race": { 3 | "has": [ 4 | "global" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/subprocess.json: -------------------------------------------------------------------------------- 1 | { 2 | "Process._read_stream": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "create_subprocess_exec": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "message" 15 | ] 16 | }, 17 | "create_subprocess_shell": { 18 | "has": [ 19 | "import" 20 | ], 21 | "raises": [ 22 | "RuntimeError", 23 | "TypeError", 24 | "message" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/trsock.json: -------------------------------------------------------------------------------- 1 | { 2 | "TransportSocket.__getstate__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "TransportSocket._na": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "message" 15 | ] 16 | }, 17 | "TransportSocket.setblocking": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "TransportSocket.settimeout": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/windows_events.json: -------------------------------------------------------------------------------- 1 | { 2 | "IocpProactor.__del__": { 3 | "has": [ 4 | "time" 5 | ] 6 | }, 7 | "IocpProactor._check_closed": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | }, 12 | "IocpProactor._poll": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "IocpProactor.close": { 18 | "has": [ 19 | "time" 20 | ] 21 | }, 22 | "_WaitCancelFuture.cancel": { 23 | "raises": [ 24 | "RuntimeError" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncio/windows_utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "PipeHandle.__del__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "PipeHandle.fileno": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "Popen.__init__": { 18 | "raises": [ 19 | "AssertionError" 20 | ] 21 | }, 22 | "pipe": { 23 | "has": [ 24 | "global" 25 | ], 26 | "raises": [ 27 | "FileExistsError", 28 | "TypeError" 29 | ] 30 | } 31 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/asyncore.json: -------------------------------------------------------------------------------- 1 | { 2 | "compact_traceback": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "dispatcher.connect": { 8 | "raises": [ 9 | "OSError" 10 | ] 11 | }, 12 | "dispatcher.handle_accepted": { 13 | "has": [ 14 | "stdout" 15 | ] 16 | }, 17 | "dispatcher.handle_close": { 18 | "has": [ 19 | "stdout" 20 | ] 21 | }, 22 | "dispatcher.handle_connect": { 23 | "has": [ 24 | "stdout" 25 | ] 26 | }, 27 | "dispatcher.handle_connect_event": { 28 | "raises": [ 29 | "OSError" 30 | ] 31 | }, 32 | "dispatcher.handle_error": { 33 | "has": [ 34 | "stdout" 35 | ], 36 | "raises": [ 37 | "AssertionError" 38 | ] 39 | }, 40 | "dispatcher.handle_expt": { 41 | "has": [ 42 | "stdout" 43 | ] 44 | }, 45 | "dispatcher.handle_read": { 46 | "has": [ 47 | "stdout" 48 | ] 49 | }, 50 | "dispatcher.handle_write": { 51 | "has": [ 52 | "stdout" 53 | ] 54 | }, 55 | "dispatcher.log": { 56 | "has": [ 57 | "stderr" 58 | ] 59 | }, 60 | "dispatcher.log_info": { 61 | "has": [ 62 | "stdout" 63 | ] 64 | }, 65 | "dispatcher_with_send.send": { 66 | "has": [ 67 | "stdout" 68 | ] 69 | } 70 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/binhex.json: -------------------------------------------------------------------------------- 1 | { 2 | "BinHex._writeinfo": { 3 | "raises": [ 4 | "Error" 5 | ] 6 | }, 7 | "BinHex.close_data": { 8 | "raises": [ 9 | "Error" 10 | ] 11 | }, 12 | "BinHex.write": { 13 | "raises": [ 14 | "Error" 15 | ] 16 | }, 17 | "BinHex.write_rsrc": { 18 | "raises": [ 19 | "Error" 20 | ] 21 | }, 22 | "HexBin._checkcrc": { 23 | "raises": [ 24 | "Error" 25 | ] 26 | }, 27 | "HexBin.close_data": { 28 | "raises": [ 29 | "Error" 30 | ] 31 | }, 32 | "HexBin.read": { 33 | "raises": [ 34 | "Error" 35 | ] 36 | }, 37 | "HexBin.read_rsrc": { 38 | "raises": [ 39 | "Error" 40 | ] 41 | }, 42 | "_ignore_deprecation_warning": { 43 | "has": [ 44 | "import" 45 | ], 46 | "raises": [ 47 | "AssertionError", 48 | "TypeError", 49 | "ValueError" 50 | ] 51 | }, 52 | "getfileinfo": { 53 | "raises": [ 54 | "TypeError" 55 | ] 56 | } 57 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/bisect.json: -------------------------------------------------------------------------------- 1 | { 2 | "bisect_left": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "bisect_right": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "insort_left": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "insort_right": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/bz2.json: -------------------------------------------------------------------------------- 1 | { 2 | "BZ2File.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "ValueError", 10 | "message" 11 | ] 12 | }, 13 | "BZ2File.readline": { 14 | "raises": [ 15 | "TypeError" 16 | ] 17 | }, 18 | "BZ2File.readlines": { 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | }, 23 | "open": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/cProfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profile.dump_stats": { 3 | "has": [ 4 | "import", 5 | "read" 6 | ] 7 | }, 8 | "Profile.print_stats": { 9 | "has": [ 10 | "import" 11 | ] 12 | }, 13 | "Profile.run": { 14 | "has": [ 15 | "import" 16 | ] 17 | }, 18 | "Profile.runcall": { 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | }, 23 | "main": { 24 | "has": [ 25 | "import", 26 | "read" 27 | ], 28 | "raises": [ 29 | "SystemExit", 30 | "TypeError" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/cgitb.json: -------------------------------------------------------------------------------- 1 | { 2 | "Hook.handle": { 3 | "raises": [ 4 | "FileExistsError" 5 | ] 6 | }, 7 | "html": { 8 | "has": [ 9 | "time" 10 | ], 11 | "raises": [ 12 | "TypeError" 13 | ] 14 | }, 15 | "text": { 16 | "has": [ 17 | "time" 18 | ], 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/chunk.json: -------------------------------------------------------------------------------- 1 | { 2 | "Chunk.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "EOFError" 8 | ] 9 | }, 10 | "Chunk.isatty": { 11 | "raises": [ 12 | "ValueError" 13 | ] 14 | }, 15 | "Chunk.read": { 16 | "raises": [ 17 | "ValueError" 18 | ] 19 | }, 20 | "Chunk.seek": { 21 | "raises": [ 22 | "OSError", 23 | "RuntimeError", 24 | "ValueError" 25 | ] 26 | }, 27 | "Chunk.skip": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "Chunk.tell": { 33 | "raises": [ 34 | "ValueError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/cmd.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cmd.columnize": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "Cmd.complete": { 8 | "has": [ 9 | "import" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/code.json: -------------------------------------------------------------------------------- 1 | { 2 | "InteractiveConsole.interact": { 3 | "has": [ 4 | "stderr" 5 | ] 6 | }, 7 | "InteractiveConsole.raw_input": { 8 | "has": [ 9 | "stdin" 10 | ] 11 | }, 12 | "InteractiveInterpreter.showsyntaxerror": { 13 | "has": [ 14 | "stderr" 15 | ] 16 | }, 17 | "InteractiveInterpreter.write": { 18 | "has": [ 19 | "stderr" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/codecs.json: -------------------------------------------------------------------------------- 1 | { 2 | "BufferedIncrementalDecoder._buffer_decode": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "BufferedIncrementalEncoder._buffer_encode": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | }, 12 | "Codec.decode": { 13 | "raises": [ 14 | "NotImplementedError" 15 | ] 16 | }, 17 | "Codec.encode": { 18 | "raises": [ 19 | "NotImplementedError" 20 | ] 21 | }, 22 | "IncrementalDecoder.decode": { 23 | "raises": [ 24 | "NotImplementedError" 25 | ] 26 | }, 27 | "IncrementalEncoder.encode": { 28 | "raises": [ 29 | "NotImplementedError" 30 | ] 31 | }, 32 | "StreamReader.__next__": { 33 | "raises": [ 34 | "StopIteration" 35 | ] 36 | }, 37 | "StreamReader.decode": { 38 | "raises": [ 39 | "NotImplementedError" 40 | ] 41 | }, 42 | "getincrementaldecoder": { 43 | "raises": [ 44 | "LookupError" 45 | ] 46 | }, 47 | "getincrementalencoder": { 48 | "raises": [ 49 | "LookupError" 50 | ] 51 | } 52 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/codeop.json: -------------------------------------------------------------------------------- 1 | { 2 | "_maybe_compile": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/colorsys.json: -------------------------------------------------------------------------------- 1 | { 2 | "rgb_to_hls": { 3 | "raises": [ 4 | "ZeroDivisionError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/compileall.json: -------------------------------------------------------------------------------- 1 | { 2 | "_compile_file_tuple": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | }, 7 | "_walk_dir": { 8 | "has": [ 9 | "stdout" 10 | ], 11 | "raises": [ 12 | "TypeError" 13 | ] 14 | }, 15 | "compile_dir": { 16 | "has": [ 17 | "stdout" 18 | ], 19 | "raises": [ 20 | "ValueError" 21 | ] 22 | }, 23 | "compile_file": { 24 | "has": [ 25 | "stdout" 26 | ], 27 | "raises": [ 28 | "NotImplementedError", 29 | "TypeError", 30 | "ValueError" 31 | ] 32 | }, 33 | "compile_path": { 34 | "has": [ 35 | "stdout" 36 | ] 37 | }, 38 | "main": { 39 | "has": [ 40 | "import", 41 | "stdout" 42 | ], 43 | "raises": [ 44 | "TypeError", 45 | "ValueError" 46 | ] 47 | } 48 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/contextlib.json: -------------------------------------------------------------------------------- 1 | { 2 | "AsyncExitStack.push_async_callback": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "_AsyncGeneratorContextManager.__aenter__": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | }, 12 | "_AsyncGeneratorContextManager.__aexit__": { 13 | "raises": [ 14 | "RuntimeError" 15 | ] 16 | }, 17 | "_BaseExitStack.callback": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "_GeneratorContextManager.__enter__": { 23 | "raises": [ 24 | "RuntimeError" 25 | ] 26 | }, 27 | "_GeneratorContextManager.__exit__": { 28 | "raises": [ 29 | "RuntimeError" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/copy.json: -------------------------------------------------------------------------------- 1 | { 2 | "_deepcopy_dict": { 3 | "raises": [ 4 | "Error" 5 | ] 6 | }, 7 | "_deepcopy_list": { 8 | "raises": [ 9 | "Error" 10 | ] 11 | }, 12 | "_deepcopy_method": { 13 | "raises": [ 14 | "Error" 15 | ] 16 | }, 17 | "_reconstruct": { 18 | "raises": [ 19 | "Error" 20 | ] 21 | }, 22 | "copy": { 23 | "raises": [ 24 | "Error" 25 | ] 26 | }, 27 | "deepcopy": { 28 | "raises": [ 29 | "Error" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/copyreg.json: -------------------------------------------------------------------------------- 1 | { 2 | "_reduce_ex": { 3 | "raises": [ 4 | "AssertionError", 5 | "TypeError" 6 | ] 7 | }, 8 | "add_extension": { 9 | "raises": [ 10 | "ValueError" 11 | ] 12 | }, 13 | "constructor": { 14 | "raises": [ 15 | "TypeError" 16 | ] 17 | }, 18 | "pickle": { 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | }, 23 | "remove_extension": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/crypt.json: -------------------------------------------------------------------------------- 1 | { 2 | "_add_method": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError" 6 | ] 7 | }, 8 | "crypt": { 9 | "raises": [ 10 | "TypeError", 11 | "ValueError" 12 | ] 13 | }, 14 | "mksalt": { 15 | "raises": [ 16 | "TypeError", 17 | "ValueError" 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/csv.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dialect._validate": { 3 | "raises": [ 4 | "Error" 5 | ] 6 | }, 7 | "DictWriter.__init__": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "DictWriter._dict_to_list": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "Sniffer._guess_quote_and_delimiter": { 18 | "raises": [ 19 | "TypeError", 20 | "ValueError" 21 | ] 22 | }, 23 | "Sniffer.sniff": { 24 | "raises": [ 25 | "Error" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/dataclasses.json: -------------------------------------------------------------------------------- 1 | { 2 | "_asdict_inner": { 3 | "raises": [ 4 | "Error" 5 | ] 6 | }, 7 | "_astuple_inner": { 8 | "raises": [ 9 | "Error" 10 | ] 11 | }, 12 | "_get_field": { 13 | "raises": [ 14 | "TypeError", 15 | "ValueError" 16 | ] 17 | }, 18 | "_hash_exception": { 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | }, 23 | "_init_fn": { 24 | "raises": [ 25 | "TypeError" 26 | ] 27 | }, 28 | "_process_class": { 29 | "raises": [ 30 | "TypeError", 31 | "ValueError" 32 | ] 33 | }, 34 | "asdict": { 35 | "raises": [ 36 | "TypeError" 37 | ] 38 | }, 39 | "astuple": { 40 | "raises": [ 41 | "TypeError" 42 | ] 43 | }, 44 | "field": { 45 | "raises": [ 46 | "ValueError" 47 | ] 48 | }, 49 | "fields": { 50 | "raises": [ 51 | "TypeError" 52 | ] 53 | }, 54 | "make_dataclass": { 55 | "raises": [ 56 | "TypeError" 57 | ] 58 | }, 59 | "replace": { 60 | "raises": [ 61 | "TypeError", 62 | "ValueError" 63 | ] 64 | } 65 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/difflib.json: -------------------------------------------------------------------------------- 1 | { 2 | "Differ._fancy_replace": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "Differ._plain_replace": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "Differ.compare": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "HtmlDiff.make_table": { 18 | "has": [ 19 | "import" 20 | ] 21 | }, 22 | "_check_types": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | }, 27 | "_mdiff": { 28 | "has": [ 29 | "import" 30 | ], 31 | "raises": [ 32 | "TypeError", 33 | "ValueError" 34 | ] 35 | }, 36 | "_test": { 37 | "has": [ 38 | "global", 39 | "import", 40 | "stdout" 41 | ], 42 | "raises": [ 43 | "TypeError" 44 | ] 45 | }, 46 | "context_diff": { 47 | "raises": [ 48 | "TypeError" 49 | ] 50 | }, 51 | "diff_bytes": { 52 | "raises": [ 53 | "TypeError" 54 | ] 55 | }, 56 | "get_close_matches": { 57 | "raises": [ 58 | "ValueError" 59 | ] 60 | }, 61 | "restore": { 62 | "raises": [ 63 | "ValueError" 64 | ] 65 | }, 66 | "unified_diff": { 67 | "raises": [ 68 | "TypeError" 69 | ] 70 | } 71 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/dis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bytecode.__init__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "Bytecode.dis": { 8 | "has": [ 9 | "stdout" 10 | ] 11 | }, 12 | "_disassemble_bytes": { 13 | "has": [ 14 | "stdout" 15 | ] 16 | }, 17 | "_disassemble_recursive": { 18 | "has": [ 19 | "stdout" 20 | ] 21 | }, 22 | "_disassemble_str": { 23 | "has": [ 24 | "stdout" 25 | ] 26 | }, 27 | "_get_code_object": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | }, 32 | "_test": { 33 | "has": [ 34 | "import", 35 | "stdout" 36 | ], 37 | "raises": [ 38 | "TypeError" 39 | ] 40 | }, 41 | "code_info": { 42 | "raises": [ 43 | "TypeError" 44 | ] 45 | }, 46 | "dis": { 47 | "has": [ 48 | "stdout" 49 | ], 50 | "raises": [ 51 | "RuntimeError", 52 | "TypeError" 53 | ] 54 | }, 55 | "disassemble": { 56 | "has": [ 57 | "stdout" 58 | ] 59 | }, 60 | "distb": { 61 | "raises": [ 62 | "RuntimeError" 63 | ] 64 | }, 65 | "get_instructions": { 66 | "raises": [ 67 | "TypeError" 68 | ] 69 | }, 70 | "show_code": { 71 | "has": [ 72 | "stdout" 73 | ] 74 | } 75 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/filecmp.json: -------------------------------------------------------------------------------- 1 | { 2 | "_do_cmp": { 3 | "has": [ 4 | "read" 5 | ] 6 | }, 7 | "cmp": { 8 | "has": [ 9 | "read" 10 | ] 11 | }, 12 | "cmpfiles": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "demo": { 18 | "has": [ 19 | "import", 20 | "stdout" 21 | ] 22 | }, 23 | "dircmp.__getattr__": { 24 | "raises": [ 25 | "AttributeError" 26 | ] 27 | }, 28 | "dircmp.phase2": { 29 | "raises": [ 30 | "TypeError" 31 | ] 32 | }, 33 | "dircmp.phase4": { 34 | "raises": [ 35 | "TypeError" 36 | ] 37 | }, 38 | "dircmp.report": { 39 | "has": [ 40 | "stdout" 41 | ] 42 | }, 43 | "dircmp.report_full_closure": { 44 | "has": [ 45 | "stdout" 46 | ] 47 | }, 48 | "dircmp.report_partial_closure": { 49 | "has": [ 50 | "stdout" 51 | ] 52 | } 53 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/fnmatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "_compile_pattern": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "filter": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "fnmatch": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "translate": { 18 | "raises": [ 19 | "AssertionError" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/formatter.json: -------------------------------------------------------------------------------- 1 | { 2 | "AbstractWriter.new_alignment": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | }, 7 | "AbstractWriter.new_font": { 8 | "has": [ 9 | "stdout" 10 | ] 11 | }, 12 | "AbstractWriter.new_margin": { 13 | "has": [ 14 | "stdout" 15 | ] 16 | }, 17 | "AbstractWriter.new_spacing": { 18 | "has": [ 19 | "stdout" 20 | ] 21 | }, 22 | "AbstractWriter.new_styles": { 23 | "has": [ 24 | "stdout" 25 | ] 26 | }, 27 | "AbstractWriter.send_flowing_data": { 28 | "has": [ 29 | "stdout" 30 | ] 31 | }, 32 | "AbstractWriter.send_hor_rule": { 33 | "has": [ 34 | "stdout" 35 | ] 36 | }, 37 | "AbstractWriter.send_label_data": { 38 | "has": [ 39 | "stdout" 40 | ] 41 | }, 42 | "AbstractWriter.send_line_break": { 43 | "has": [ 44 | "stdout" 45 | ] 46 | }, 47 | "AbstractWriter.send_literal_data": { 48 | "has": [ 49 | "stdout" 50 | ] 51 | }, 52 | "AbstractWriter.send_paragraph": { 53 | "has": [ 54 | "stdout" 55 | ] 56 | }, 57 | "test": { 58 | "has": [ 59 | "read" 60 | ] 61 | } 62 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/fractions.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fraction.__new__": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError", 6 | "ZeroDivisionError" 7 | ] 8 | }, 9 | "Fraction.from_decimal": { 10 | "has": [ 11 | "import" 12 | ], 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "Fraction.from_float": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "Fraction.limit_denominator": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "gcd": { 28 | "has": [ 29 | "import" 30 | ], 31 | "raises": [ 32 | "RuntimeError", 33 | "TypeError", 34 | "message" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/functools.json: -------------------------------------------------------------------------------- 1 | { 2 | "_find_impl": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "cached_property.__get__": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "cached_property.__set_name__": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "lru_cache": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "partial.__call__": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | }, 27 | "partial.__new__": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | }, 32 | "partial.__setstate__": { 33 | "raises": [ 34 | "TypeError" 35 | ] 36 | }, 37 | "partialmethod.__init__": { 38 | "raises": [ 39 | "TypeError" 40 | ] 41 | }, 42 | "reduce": { 43 | "raises": [ 44 | "TypeError" 45 | ] 46 | }, 47 | "singledispatch": { 48 | "has": [ 49 | "import" 50 | ] 51 | }, 52 | "singledispatchmethod.__init__": { 53 | "has": [ 54 | "import" 55 | ], 56 | "raises": [ 57 | "TypeError" 58 | ] 59 | }, 60 | "singledispatchmethod.register": { 61 | "has": [ 62 | "global", 63 | "import" 64 | ], 65 | "raises": [ 66 | "TypeError" 67 | ] 68 | }, 69 | "total_ordering": { 70 | "raises": [ 71 | "ValueError" 72 | ] 73 | } 74 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/genericpath.json: -------------------------------------------------------------------------------- 1 | { 2 | "_check_arg_types": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/getopt.json: -------------------------------------------------------------------------------- 1 | { 2 | "do_longs": { 3 | "raises": [ 4 | "AssertionError", 5 | "GetoptError" 6 | ] 7 | }, 8 | "long_has_args": { 9 | "raises": [ 10 | "AssertionError", 11 | "GetoptError" 12 | ] 13 | }, 14 | "short_has_arg": { 15 | "raises": [ 16 | "GetoptError" 17 | ] 18 | } 19 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/getpass.json: -------------------------------------------------------------------------------- 1 | { 2 | "_raw_input": { 3 | "raises": [ 4 | "EOFError" 5 | ] 6 | }, 7 | "fallback_getpass": { 8 | "has": [ 9 | "import", 10 | "stdout" 11 | ], 12 | "raises": [ 13 | "EOFError", 14 | "RuntimeError", 15 | "TypeError", 16 | "message" 17 | ] 18 | }, 19 | "getuser": { 20 | "has": [ 21 | "import" 22 | ] 23 | }, 24 | "unix_getpass": { 25 | "has": [ 26 | "stdout" 27 | ] 28 | }, 29 | "win_getpass": { 30 | "has": [ 31 | "stdout" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/glob.json: -------------------------------------------------------------------------------- 1 | { 2 | "_glob1": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "_glob2": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "_iglob": { 13 | "raises": [ 14 | "AssertionError", 15 | "TypeError" 16 | ] 17 | }, 18 | "escape": { 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | }, 23 | "glob": { 24 | "raises": [ 25 | "AssertionError" 26 | ] 27 | }, 28 | "iglob": { 29 | "raises": [ 30 | "AssertionError" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/graphlib.json: -------------------------------------------------------------------------------- 1 | { 2 | "TopologicalSorter.add": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "TopologicalSorter.done": { 8 | "raises": [ 9 | "AssertionError", 10 | "ValueError" 11 | ] 12 | }, 13 | "TopologicalSorter.get_ready": { 14 | "raises": [ 15 | "ValueError" 16 | ] 17 | }, 18 | "TopologicalSorter.is_active": { 19 | "raises": [ 20 | "ValueError" 21 | ] 22 | }, 23 | "TopologicalSorter.prepare": { 24 | "raises": [ 25 | "CycleError", 26 | "ValueError" 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/hashlib.json: -------------------------------------------------------------------------------- 1 | { 2 | "__get_builtin_constructor": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "__get_openssl_constructor": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/hmac.json: -------------------------------------------------------------------------------- 1 | { 2 | "HMAC.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/http/cookies.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseCookie.__parse_string": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "Morsel.__setitem__": { 8 | "raises": [ 9 | "CookieError" 10 | ] 11 | }, 12 | "Morsel.set": { 13 | "raises": [ 14 | "CookieError" 15 | ] 16 | }, 17 | "Morsel.setdefault": { 18 | "raises": [ 19 | "CookieError" 20 | ] 21 | }, 22 | "Morsel.update": { 23 | "raises": [ 24 | "CookieError" 25 | ] 26 | }, 27 | "_getdate": { 28 | "has": [ 29 | "import" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/http/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseHTTPRequestHandler.log_message": { 3 | "has": [ 4 | "stderr" 5 | ] 6 | }, 7 | "CGIHTTPRequestHandler.is_python": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "CGIHTTPRequestHandler.run_cgi": { 13 | "has": [ 14 | "global", 15 | "import" 16 | ], 17 | "raises": [ 18 | "Error" 19 | ] 20 | }, 21 | "HTTPServer.server_bind": { 22 | "has": [ 23 | "network" 24 | ] 25 | }, 26 | "SimpleHTTPRequestHandler.guess_type": { 27 | "raises": [ 28 | "TypeError" 29 | ] 30 | }, 31 | "SimpleHTTPRequestHandler.list_directory": { 32 | "raises": [ 33 | "TypeError" 34 | ] 35 | }, 36 | "SimpleHTTPRequestHandler.send_head": { 37 | "raises": [ 38 | "TypeError", 39 | "ValueError" 40 | ] 41 | }, 42 | "SimpleHTTPRequestHandler.translate_path": { 43 | "raises": [ 44 | "TypeError" 45 | ] 46 | }, 47 | "nobody_uid": { 48 | "has": [ 49 | "global" 50 | ] 51 | }, 52 | "test": { 53 | "has": [ 54 | "stdout" 55 | ], 56 | "raises": [ 57 | "SystemExit" 58 | ] 59 | } 60 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/imghdr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": { 3 | "has": [ 4 | "import", 5 | "stderr" 6 | ], 7 | "raises": [ 8 | "SystemExit" 9 | ] 10 | }, 11 | "testall": { 12 | "has": [ 13 | "import", 14 | "stdout" 15 | ], 16 | "raises": [ 17 | "AssertionError", 18 | "TypeError" 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/imp.json: -------------------------------------------------------------------------------- 1 | { 2 | "NullImporter.__init__": { 3 | "raises": [ 4 | "ImportError" 5 | ] 6 | }, 7 | "_HackedGetData.get_data": { 8 | "has": [ 9 | "read" 10 | ] 11 | }, 12 | "cache_from_source": { 13 | "raises": [ 14 | "AssertionError", 15 | "NotImplementedError", 16 | "TypeError", 17 | "ValueError" 18 | ] 19 | }, 20 | "find_module": { 21 | "has": [ 22 | "read" 23 | ], 24 | "raises": [ 25 | "ImportError", 26 | "RuntimeError", 27 | "TypeError" 28 | ] 29 | }, 30 | "load_compiled": { 31 | "raises": [ 32 | "ImportError" 33 | ] 34 | }, 35 | "load_module": { 36 | "has": [ 37 | "import", 38 | "read" 39 | ], 40 | "raises": [ 41 | "ImportError", 42 | "ValueError" 43 | ] 44 | }, 45 | "load_package": { 46 | "raises": [ 47 | "ImportError", 48 | "TypeError", 49 | "ValueError" 50 | ] 51 | }, 52 | "load_source": { 53 | "raises": [ 54 | "ImportError" 55 | ] 56 | }, 57 | "reload": { 58 | "raises": [ 59 | "ImportError", 60 | "TypeError" 61 | ] 62 | }, 63 | "source_from_cache": { 64 | "raises": [ 65 | "NotImplementedError", 66 | "ValueError" 67 | ] 68 | } 69 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/keyword.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": { 3 | "has": [ 4 | "import", 5 | "read", 6 | "stderr", 7 | "write" 8 | ], 9 | "raises": [ 10 | "SystemExit", 11 | "TypeError", 12 | "ValueError" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/linecache.json: -------------------------------------------------------------------------------- 1 | { 2 | "clearcache": { 3 | "has": [ 4 | "global" 5 | ] 6 | }, 7 | "getlines": { 8 | "has": [ 9 | "global" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/locale.json: -------------------------------------------------------------------------------- 1 | { 2 | "_build_localename": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "_grouping_intervals": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "_parse_localename": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "_print_locale": { 18 | "has": [ 19 | "import", 20 | "stdout" 21 | ], 22 | "raises": [ 23 | "TypeError" 24 | ] 25 | }, 26 | "_test": { 27 | "has": [ 28 | "stdout" 29 | ], 30 | "raises": [ 31 | "Error" 32 | ] 33 | }, 34 | "currency": { 35 | "raises": [ 36 | "ValueError" 37 | ] 38 | }, 39 | "format": { 40 | "has": [ 41 | "import" 42 | ], 43 | "raises": [ 44 | "RuntimeError", 45 | "TypeError", 46 | "ValueError", 47 | "message" 48 | ] 49 | }, 50 | "getdefaultlocale": { 51 | "has": [ 52 | "import" 53 | ], 54 | "raises": [ 55 | "ValueError" 56 | ] 57 | }, 58 | "getlocale": { 59 | "raises": [ 60 | "Error", 61 | "TypeError", 62 | "ValueError" 63 | ] 64 | }, 65 | "resetlocale": { 66 | "raises": [ 67 | "Error", 68 | "TypeError" 69 | ] 70 | }, 71 | "setlocale": { 72 | "raises": [ 73 | "Error", 74 | "TypeError" 75 | ] 76 | } 77 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/lzma.json: -------------------------------------------------------------------------------- 1 | { 2 | "LZMAFile.__init__": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError" 6 | ] 7 | }, 8 | "open": { 9 | "raises": [ 10 | "ValueError" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/macpath.json: -------------------------------------------------------------------------------- 1 | { 2 | "join": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "normcase": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/mailcap.json: -------------------------------------------------------------------------------- 1 | { 2 | "readmailcapfile": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "show": { 13 | "has": [ 14 | "stdout" 15 | ] 16 | }, 17 | "test": { 18 | "has": [ 19 | "import", 20 | "stdout", 21 | "syscall" 22 | ] 23 | } 24 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/mimetypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "MimeTypes.__init__": { 3 | "has": [ 4 | "global", 5 | "read" 6 | ] 7 | }, 8 | "MimeTypes.guess_type": { 9 | "has": [ 10 | "global" 11 | ], 12 | "raises": [ 13 | "TypeError" 14 | ] 15 | }, 16 | "MimeTypes.read": { 17 | "has": [ 18 | "read" 19 | ] 20 | }, 21 | "_default_mime_types": { 22 | "has": [ 23 | "global" 24 | ] 25 | }, 26 | "_main": { 27 | "has": [ 28 | "import", 29 | "stdout" 30 | ], 31 | "raises": [ 32 | "SystemExit" 33 | ] 34 | }, 35 | "add_type": { 36 | "has": [ 37 | "global" 38 | ] 39 | }, 40 | "guess_all_extensions": { 41 | "has": [ 42 | "global" 43 | ] 44 | }, 45 | "guess_extension": { 46 | "has": [ 47 | "global" 48 | ] 49 | }, 50 | "guess_type": { 51 | "has": [ 52 | "global" 53 | ] 54 | }, 55 | "init": { 56 | "has": [ 57 | "global", 58 | "read" 59 | ] 60 | } 61 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/netrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "netrc.__init__": { 3 | "has": [ 4 | "import", 5 | "read" 6 | ], 7 | "raises": [ 8 | "TypeError" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/ntpath.json: -------------------------------------------------------------------------------- 1 | { 2 | "_abspath_fallback": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "commonpath": { 8 | "raises": [ 9 | "TypeError", 10 | "ValueError" 11 | ] 12 | }, 13 | "expanduser": { 14 | "raises": [ 15 | "TypeError" 16 | ] 17 | }, 18 | "expandvars": { 19 | "has": [ 20 | "import" 21 | ], 22 | "raises": [ 23 | "TypeError" 24 | ] 25 | }, 26 | "isabs": { 27 | "raises": [ 28 | "TypeError" 29 | ] 30 | }, 31 | "ismount": { 32 | "raises": [ 33 | "TypeError" 34 | ] 35 | }, 36 | "join": { 37 | "raises": [ 38 | "TypeError" 39 | ] 40 | }, 41 | "normcase": { 42 | "raises": [ 43 | "TypeError" 44 | ] 45 | }, 46 | "normpath": { 47 | "raises": [ 48 | "TypeError" 49 | ] 50 | }, 51 | "relpath": { 52 | "raises": [ 53 | "TypeError", 54 | "ValueError" 55 | ] 56 | }, 57 | "split": { 58 | "raises": [ 59 | "TypeError" 60 | ] 61 | }, 62 | "splitdrive": { 63 | "raises": [ 64 | "TypeError" 65 | ] 66 | }, 67 | "splitext": { 68 | "raises": [ 69 | "TypeError" 70 | ] 71 | } 72 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/nturl2path.json: -------------------------------------------------------------------------------- 1 | { 2 | "pathname2url": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "OSError", 8 | "TypeError" 9 | ] 10 | }, 11 | "url2pathname": { 12 | "has": [ 13 | "import" 14 | ], 15 | "raises": [ 16 | "OSError" 17 | ] 18 | } 19 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/operator.json: -------------------------------------------------------------------------------- 1 | { 2 | "attrgetter.__init__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "concat": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "iconcat": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "indexOf": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "length_hint": { 23 | "raises": [ 24 | "TypeError", 25 | "ValueError" 26 | ] 27 | }, 28 | "methodcaller.__init__": { 29 | "raises": [ 30 | "TypeError" 31 | ] 32 | }, 33 | "methodcaller.__reduce__": { 34 | "has": [ 35 | "import" 36 | ] 37 | } 38 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/pipes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Template.append": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError" 6 | ] 7 | }, 8 | "Template.copy": { 9 | "has": [ 10 | "stdout", 11 | "syscall" 12 | ] 13 | }, 14 | "Template.makepipeline": { 15 | "has": [ 16 | "stdout" 17 | ] 18 | }, 19 | "Template.open": { 20 | "has": [ 21 | "read", 22 | "syscall", 23 | "write" 24 | ], 25 | "raises": [ 26 | "ValueError" 27 | ] 28 | }, 29 | "Template.open_r": { 30 | "has": [ 31 | "import", 32 | "read", 33 | "stdout", 34 | "syscall" 35 | ], 36 | "raises": [ 37 | "TypeError", 38 | "ValueError" 39 | ] 40 | }, 41 | "Template.open_w": { 42 | "has": [ 43 | "import", 44 | "stdout", 45 | "syscall", 46 | "write" 47 | ], 48 | "raises": [ 49 | "TypeError", 50 | "ValueError" 51 | ] 52 | }, 53 | "Template.prepend": { 54 | "raises": [ 55 | "TypeError", 56 | "ValueError" 57 | ] 58 | }, 59 | "makepipeline": { 60 | "raises": [ 61 | "FileExistsError" 62 | ] 63 | } 64 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/poplib.json: -------------------------------------------------------------------------------- 1 | { 2 | "POP3.__init__": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | }, 7 | "POP3._create_socket": { 8 | "has": [ 9 | "network" 10 | ], 11 | "raises": [ 12 | "ValueError", 13 | "err" 14 | ] 15 | }, 16 | "POP3._getline": { 17 | "has": [ 18 | "stdout" 19 | ] 20 | }, 21 | "POP3._getlongresp": { 22 | "has": [ 23 | "stdout" 24 | ] 25 | }, 26 | "POP3._getresp": { 27 | "has": [ 28 | "stdout" 29 | ] 30 | }, 31 | "POP3._longcmd": { 32 | "has": [ 33 | "stdout" 34 | ] 35 | }, 36 | "POP3._putcmd": { 37 | "has": [ 38 | "stdout" 39 | ] 40 | }, 41 | "POP3._putline": { 42 | "has": [ 43 | "stdout" 44 | ] 45 | }, 46 | "POP3._shortcmd": { 47 | "has": [ 48 | "stdout" 49 | ] 50 | }, 51 | "POP3.apop": { 52 | "has": [ 53 | "import" 54 | ] 55 | }, 56 | "POP3.close": { 57 | "has": [ 58 | "network" 59 | ] 60 | }, 61 | "POP3.quit": { 62 | "has": [ 63 | "network" 64 | ] 65 | }, 66 | "POP3.stat": { 67 | "has": [ 68 | "stdout" 69 | ] 70 | }, 71 | "POP3.stls": { 72 | "raises": [ 73 | "TypeError", 74 | "ValueError" 75 | ] 76 | } 77 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/pprint.json: -------------------------------------------------------------------------------- 1 | { 2 | "PrettyPrinter.__init__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "PrettyPrinter._pprint_str": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "_perfcheck": { 13 | "has": [ 14 | "import", 15 | "stdout", 16 | "time" 17 | ] 18 | } 19 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profile._calibrate_inner": { 3 | "has": [ 4 | "stdout" 5 | ], 6 | "raises": [ 7 | "ValueError", 8 | "ZeroDivisionError" 9 | ] 10 | }, 11 | "Profile.calibrate": { 12 | "raises": [ 13 | "TypeError" 14 | ] 15 | }, 16 | "Profile.dump_stats": { 17 | "has": [ 18 | "read" 19 | ] 20 | }, 21 | "Profile.print_stats": { 22 | "has": [ 23 | "import" 24 | ] 25 | }, 26 | "Profile.run": { 27 | "has": [ 28 | "import" 29 | ] 30 | }, 31 | "Profile.runcall": { 32 | "raises": [ 33 | "TypeError" 34 | ] 35 | }, 36 | "Profile.simulate_call": { 37 | "raises": [ 38 | "AssertionError" 39 | ] 40 | }, 41 | "Profile.trace_dispatch_call": { 42 | "raises": [ 43 | "AssertionError" 44 | ] 45 | }, 46 | "Profile.trace_dispatch_mac": { 47 | "raises": [ 48 | "ZeroDivisionError" 49 | ] 50 | }, 51 | "Profile.trace_dispatch_return": { 52 | "raises": [ 53 | "AssertionError" 54 | ] 55 | }, 56 | "main": { 57 | "has": [ 58 | "import", 59 | "read" 60 | ], 61 | "raises": [ 62 | "SystemExit", 63 | "TypeError" 64 | ] 65 | } 66 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/pstats.json: -------------------------------------------------------------------------------- 1 | { 2 | "Stats.dump_stats": { 3 | "has": [ 4 | "read" 5 | ] 6 | }, 7 | "Stats.get_print_list": { 8 | "has": [ 9 | "stdout" 10 | ] 11 | }, 12 | "Stats.init": { 13 | "has": [ 14 | "read", 15 | "stdout" 16 | ] 17 | }, 18 | "Stats.load_stats": { 19 | "has": [ 20 | "read" 21 | ], 22 | "raises": [ 23 | "TypeError" 24 | ] 25 | }, 26 | "Stats.print_call_heading": { 27 | "has": [ 28 | "stdout" 29 | ] 30 | }, 31 | "Stats.print_call_line": { 32 | "has": [ 33 | "stdout" 34 | ] 35 | }, 36 | "Stats.print_callees": { 37 | "has": [ 38 | "stdout" 39 | ] 40 | }, 41 | "Stats.print_callers": { 42 | "has": [ 43 | "stdout" 44 | ] 45 | }, 46 | "Stats.print_line": { 47 | "has": [ 48 | "stdout" 49 | ] 50 | }, 51 | "Stats.print_stats": { 52 | "has": [ 53 | "stdout" 54 | ] 55 | }, 56 | "Stats.print_title": { 57 | "has": [ 58 | "stdout" 59 | ] 60 | }, 61 | "Stats.sort_stats": { 62 | "raises": [ 63 | "TypeError" 64 | ] 65 | } 66 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/pty.json: -------------------------------------------------------------------------------- 1 | { 2 | "_open_terminal": { 3 | "raises": [ 4 | "OSError" 5 | ] 6 | }, 7 | "fork": { 8 | "has": [ 9 | "syscall" 10 | ] 11 | }, 12 | "master_open": { 13 | "raises": [ 14 | "OSError" 15 | ] 16 | }, 17 | "openpty": { 18 | "raises": [ 19 | "OSError" 20 | ] 21 | }, 22 | "spawn": { 23 | "has": [ 24 | "syscall" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/py_compile.json: -------------------------------------------------------------------------------- 1 | { 2 | "compile": { 3 | "has": [ 4 | "stderr" 5 | ], 6 | "raises": [ 7 | "AssertionError", 8 | "FileExistsError", 9 | "NotImplementedError", 10 | "TypeError", 11 | "ValueError", 12 | "py_exc" 13 | ] 14 | }, 15 | "main": { 16 | "has": [ 17 | "stderr" 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/pyclbr.json: -------------------------------------------------------------------------------- 1 | { 2 | "_main": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "TypeError" 8 | ] 9 | }, 10 | "_readmodule": { 11 | "raises": [ 12 | "ImportError", 13 | "ModuleNotFoundError", 14 | "ValueError" 15 | ] 16 | }, 17 | "readmodule_ex": { 18 | "raises": [ 19 | "ImportError", 20 | "ModuleNotFoundError" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/queue.json: -------------------------------------------------------------------------------- 1 | { 2 | "Queue.get": { 3 | "raises": [ 4 | "Empty", 5 | "ValueError" 6 | ] 7 | }, 8 | "Queue.put": { 9 | "raises": [ 10 | "Full", 11 | "ValueError" 12 | ] 13 | }, 14 | "Queue.task_done": { 15 | "raises": [ 16 | "ValueError" 17 | ] 18 | }, 19 | "_PySimpleQueue.get": { 20 | "raises": [ 21 | "Empty", 22 | "ValueError" 23 | ] 24 | } 25 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/quopri.json: -------------------------------------------------------------------------------- 1 | { 2 | "decodestring": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "encodestring": { 8 | "has": [ 9 | "import" 10 | ] 11 | }, 12 | "ishex": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "main": { 18 | "has": [ 19 | "import", 20 | "stderr", 21 | "stdout" 22 | ], 23 | "raises": [ 24 | "SystemExit" 25 | ] 26 | }, 27 | "needsquoting": { 28 | "raises": [ 29 | "AssertionError" 30 | ] 31 | }, 32 | "quote": { 33 | "raises": [ 34 | "AssertionError" 35 | ] 36 | }, 37 | "unhex": { 38 | "raises": [ 39 | "AssertionError" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/re.json: -------------------------------------------------------------------------------- 1 | { 2 | "Scanner.__init__": { 3 | "has": [ 4 | "import", 5 | "stdout" 6 | ], 7 | "raises": [ 8 | "AssertionError", 9 | "ValueError" 10 | ] 11 | }, 12 | "_compile": { 13 | "has": [ 14 | "import", 15 | "stdout" 16 | ], 17 | "raises": [ 18 | "AssertionError", 19 | "TypeError", 20 | "ValueError" 21 | ] 22 | }, 23 | "compile": { 24 | "raises": [ 25 | "TypeError", 26 | "ValueError" 27 | ] 28 | }, 29 | "template": { 30 | "raises": [ 31 | "TypeError", 32 | "ValueError" 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/rlcompleter.json: -------------------------------------------------------------------------------- 1 | { 2 | "Completer.__init__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "Completer.attr_matches": { 8 | "has": [ 9 | "import" 10 | ] 11 | }, 12 | "Completer.complete": { 13 | "has": [ 14 | "import" 15 | ] 16 | }, 17 | "Completer.global_matches": { 18 | "has": [ 19 | "import" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/runpy.json: -------------------------------------------------------------------------------- 1 | { 2 | "_ModifiedArgv0.__enter__": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "_get_code_from_file": { 8 | "has": [ 9 | "import", 10 | "read" 11 | ], 12 | "raises": [ 13 | "TypeError" 14 | ] 15 | }, 16 | "_get_module_details": { 17 | "has": [ 18 | "import" 19 | ], 20 | "raises": [ 21 | "RuntimeError", 22 | "TypeError", 23 | "message" 24 | ] 25 | }, 26 | "_run_module_as_main": { 27 | "raises": [ 28 | "SystemExit" 29 | ] 30 | }, 31 | "run_module": { 32 | "has": [ 33 | "import" 34 | ] 35 | }, 36 | "run_path": { 37 | "has": [ 38 | "read" 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | "randbelow": { 3 | "has": [ 4 | "random" 5 | ], 6 | "raises": [ 7 | "ValueError" 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/selectors.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseSelector.get_key": { 3 | "raises": [ 4 | "KeyError", 5 | "RuntimeError" 6 | ] 7 | }, 8 | "BaseSelector.get_map": { 9 | "raises": [ 10 | "NotImplementedError" 11 | ] 12 | }, 13 | "BaseSelector.register": { 14 | "raises": [ 15 | "NotImplementedError" 16 | ] 17 | }, 18 | "BaseSelector.select": { 19 | "raises": [ 20 | "NotImplementedError" 21 | ] 22 | }, 23 | "BaseSelector.unregister": { 24 | "raises": [ 25 | "NotImplementedError" 26 | ] 27 | }, 28 | "_BaseSelectorImpl.modify": { 29 | "raises": [ 30 | "KeyError" 31 | ] 32 | }, 33 | "_BaseSelectorImpl.register": { 34 | "raises": [ 35 | "KeyError", 36 | "ValueError" 37 | ] 38 | }, 39 | "_BaseSelectorImpl.unregister": { 40 | "raises": [ 41 | "KeyError" 42 | ] 43 | }, 44 | "_PollLikeSelector.modify": { 45 | "raises": [ 46 | "KeyError" 47 | ] 48 | }, 49 | "_SelectorMapping.__getitem__": { 50 | "raises": [ 51 | "KeyError" 52 | ] 53 | }, 54 | "_fileobj_to_fd": { 55 | "raises": [ 56 | "ValueError" 57 | ] 58 | } 59 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/shelve.json: -------------------------------------------------------------------------------- 1 | { 2 | "DbfilenameShelf.__init__": { 3 | "has": [ 4 | "global", 5 | "import" 6 | ], 7 | "raises": [ 8 | "ImportError" 9 | ] 10 | }, 11 | "_ClosedDict.closed": { 12 | "raises": [ 13 | "ValueError" 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/shlex.json: -------------------------------------------------------------------------------- 1 | { 2 | "shlex.__next__": { 3 | "has": [ 4 | "stdout" 5 | ], 6 | "raises": [ 7 | "StopIteration" 8 | ] 9 | }, 10 | "shlex.get_token": { 11 | "has": [ 12 | "stdout" 13 | ] 14 | }, 15 | "shlex.pop_source": { 16 | "has": [ 17 | "stdout" 18 | ] 19 | }, 20 | "shlex.push_source": { 21 | "has": [ 22 | "stdout" 23 | ] 24 | }, 25 | "shlex.push_token": { 26 | "has": [ 27 | "stdout" 28 | ] 29 | }, 30 | "shlex.read_token": { 31 | "has": [ 32 | "stdout" 33 | ] 34 | }, 35 | "shlex.sourcehook": { 36 | "raises": [ 37 | "TypeError" 38 | ] 39 | }, 40 | "split": { 41 | "has": [ 42 | "import" 43 | ], 44 | "raises": [ 45 | "RuntimeError", 46 | "TypeError", 47 | "message" 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/sndhdr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": { 3 | "has": [ 4 | "import", 5 | "stderr" 6 | ], 7 | "raises": [ 8 | "SystemExit" 9 | ] 10 | }, 11 | "test_aifc": { 12 | "has": [ 13 | "import" 14 | ] 15 | }, 16 | "test_wav": { 17 | "has": [ 18 | "import" 19 | ] 20 | }, 21 | "testall": { 22 | "has": [ 23 | "import", 24 | "stdout" 25 | ], 26 | "raises": [ 27 | "AssertionError", 28 | "TypeError" 29 | ] 30 | }, 31 | "what": { 32 | "has": [ 33 | "read" 34 | ] 35 | }, 36 | "whathdr": { 37 | "has": [ 38 | "read" 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/socketserver.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseServer._handle_request_noblock": { 3 | "has": [ 4 | "import", 5 | "stderr" 6 | ] 7 | }, 8 | "BaseServer.handle_error": { 9 | "has": [ 10 | "import", 11 | "stderr", 12 | "stdout" 13 | ] 14 | }, 15 | "DatagramRequestHandler.setup": { 16 | "has": [ 17 | "import" 18 | ] 19 | }, 20 | "TCPServer.__init__": { 21 | "has": [ 22 | "network" 23 | ] 24 | }, 25 | "TCPServer.server_activate": { 26 | "has": [ 27 | "network" 28 | ] 29 | }, 30 | "TCPServer.server_bind": { 31 | "has": [ 32 | "network" 33 | ] 34 | }, 35 | "TCPServer.server_close": { 36 | "has": [ 37 | "network" 38 | ] 39 | } 40 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/sre_compile.json: -------------------------------------------------------------------------------- 1 | { 2 | "_bytes_to_codes": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "_code": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "_compile_info": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "compile": { 18 | "has": [ 19 | "import", 20 | "stdout" 21 | ], 22 | "raises": [ 23 | "AssertionError", 24 | "ValueError" 25 | ] 26 | }, 27 | "dis": { 28 | "has": [ 29 | "global", 30 | "import" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/sre_parse.json: -------------------------------------------------------------------------------- 1 | { 2 | "SubPattern.dump": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | }, 7 | "_parse_flags": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | }, 12 | "fix_flags": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "parse": { 18 | "has": [ 19 | "stdout" 20 | ], 21 | "raises": [ 22 | "AssertionError", 23 | "ValueError" 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/string.json: -------------------------------------------------------------------------------- 1 | { 2 | "Formatter._vformat": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "Formatter.convert_field": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "Formatter.format": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "Template.__init_subclass__": { 18 | "raises": [ 19 | "TypeError", 20 | "ValueError" 21 | ] 22 | }, 23 | "Template._invalid": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "Template.safe_substitute": { 29 | "raises": [ 30 | "TypeError" 31 | ] 32 | }, 33 | "Template.substitute": { 34 | "raises": [ 35 | "TypeError" 36 | ] 37 | }, 38 | "_TemplateMetaclass.__init__": { 39 | "raises": [ 40 | "TypeError", 41 | "ValueError" 42 | ] 43 | } 44 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/subprocess.json: -------------------------------------------------------------------------------- 1 | { 2 | "CompletedProcess.check_returncode": { 3 | "raises": [ 4 | "CalledProcessError" 5 | ] 6 | }, 7 | "Popen.__del__": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "message" 15 | ] 16 | }, 17 | "Popen.__init__": { 18 | "has": [ 19 | "import" 20 | ], 21 | "raises": [ 22 | "RuntimeError", 23 | "SubprocessError", 24 | "TypeError", 25 | "ValueError", 26 | "message" 27 | ] 28 | }, 29 | "Popen._check_timeout": { 30 | "raises": [ 31 | "TimeoutExpired" 32 | ] 33 | }, 34 | "Popen.communicate": { 35 | "raises": [ 36 | "ValueError" 37 | ] 38 | }, 39 | "check_call": { 40 | "raises": [ 41 | "CalledProcessError" 42 | ] 43 | }, 44 | "check_output": { 45 | "raises": [ 46 | "ValueError" 47 | ] 48 | }, 49 | "run": { 50 | "raises": [ 51 | "CalledProcessError", 52 | "ValueError" 53 | ] 54 | } 55 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/symbol.json: -------------------------------------------------------------------------------- 1 | { 2 | "_main": { 3 | "has": [ 4 | "import", 5 | "stderr", 6 | "stdout" 7 | ], 8 | "raises": [ 9 | "SystemExit", 10 | "TypeError", 11 | "ValueError" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/symtable.json: -------------------------------------------------------------------------------- 1 | { 2 | "Symbol.get_namespace": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "SymbolTable.get_type": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/tabnanny.json: -------------------------------------------------------------------------------- 1 | { 2 | "check": { 3 | "has": [ 4 | "stderr", 5 | "stdout" 6 | ], 7 | "raises": [ 8 | "TypeError" 9 | ] 10 | }, 11 | "errprint": { 12 | "has": [ 13 | "stderr" 14 | ] 15 | }, 16 | "main": { 17 | "has": [ 18 | "global", 19 | "import", 20 | "stderr", 21 | "stdout" 22 | ] 23 | }, 24 | "process_tokens": { 25 | "raises": [ 26 | "NannyNag" 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/telnetlib.json: -------------------------------------------------------------------------------- 1 | { 2 | "Telnet.__del__": { 3 | "has": [ 4 | "network" 5 | ] 6 | }, 7 | "Telnet.__exit__": { 8 | "has": [ 9 | "network" 10 | ] 11 | }, 12 | "Telnet.close": { 13 | "has": [ 14 | "network" 15 | ] 16 | }, 17 | "Telnet.expect": { 18 | "has": [ 19 | "import" 20 | ], 21 | "raises": [ 22 | "EOFError", 23 | "TypeError", 24 | "ValueError" 25 | ] 26 | }, 27 | "Telnet.fill_rawq": { 28 | "has": [ 29 | "stdout" 30 | ] 31 | }, 32 | "Telnet.interact": { 33 | "has": [ 34 | "import" 35 | ] 36 | }, 37 | "Telnet.msg": { 38 | "has": [ 39 | "stdout" 40 | ] 41 | }, 42 | "Telnet.mt_interact": { 43 | "has": [ 44 | "import" 45 | ] 46 | }, 47 | "Telnet.open": { 48 | "has": [ 49 | "network" 50 | ], 51 | "raises": [ 52 | "err" 53 | ] 54 | }, 55 | "Telnet.rawq_getchar": { 56 | "raises": [ 57 | "EOFError" 58 | ] 59 | }, 60 | "Telnet.read_very_lazy": { 61 | "raises": [ 62 | "EOFError" 63 | ] 64 | }, 65 | "Telnet.write": { 66 | "has": [ 67 | "stdout" 68 | ] 69 | } 70 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/textwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "TextWrapper._wrap_chunks": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "dedent": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/timeit.json: -------------------------------------------------------------------------------- 1 | { 2 | "Timer.__init__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "Timer.print_exc": { 8 | "has": [ 9 | "import", 10 | "stdout" 11 | ] 12 | }, 13 | "main": { 14 | "has": [ 15 | "global", 16 | "import", 17 | "stderr", 18 | "stdout" 19 | ], 20 | "raises": [ 21 | "RuntimeError", 22 | "TypeError", 23 | "message" 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/token.json: -------------------------------------------------------------------------------- 1 | { 2 | "_main": { 3 | "has": [ 4 | "import", 5 | "stderr", 6 | "stdout" 7 | ], 8 | "raises": [ 9 | "SystemExit", 10 | "TypeError", 11 | "ValueError" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/tokenize.json: -------------------------------------------------------------------------------- 1 | { 2 | "Untokenizer.add_whitespace": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "_compile": { 8 | "raises": [ 9 | "TypeError", 10 | "ValueError" 11 | ] 12 | }, 13 | "detect_encoding": { 14 | "raises": [ 15 | "SyntaxError" 16 | ] 17 | }, 18 | "main": { 19 | "has": [ 20 | "import", 21 | "stderr", 22 | "stdout" 23 | ], 24 | "raises": [ 25 | "SystemExit" 26 | ] 27 | }, 28 | "tokenize": { 29 | "has": [ 30 | "import" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/traceback.json: -------------------------------------------------------------------------------- 1 | { 2 | "print_exc": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | }, 7 | "print_exception": { 8 | "has": [ 9 | "stdout" 10 | ] 11 | }, 12 | "print_last": { 13 | "has": [ 14 | "stdout" 15 | ], 16 | "raises": [ 17 | "ValueError" 18 | ] 19 | }, 20 | "print_list": { 21 | "has": [ 22 | "stdout" 23 | ] 24 | }, 25 | "print_stack": { 26 | "has": [ 27 | "stdout" 28 | ] 29 | }, 30 | "print_tb": { 31 | "has": [ 32 | "stdout" 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/tracemalloc.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseFilter._match": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "Snapshot._group_by": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "Snapshot.dump": { 13 | "has": [ 14 | "read" 15 | ] 16 | }, 17 | "Snapshot.filter_traces": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "Snapshot.load": { 23 | "has": [ 24 | "read" 25 | ] 26 | }, 27 | "_normalize_filename": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | }, 32 | "take_snapshot": { 33 | "raises": [ 34 | "RuntimeError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/types.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicClassAttribute.__delete__": { 3 | "raises": [ 4 | "AttributeError" 5 | ] 6 | }, 7 | "DynamicClassAttribute.__get__": { 8 | "raises": [ 9 | "AttributeError" 10 | ] 11 | }, 12 | "DynamicClassAttribute.__set__": { 13 | "raises": [ 14 | "AttributeError" 15 | ] 16 | }, 17 | "_calculate_meta": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "coroutine": { 23 | "has": [ 24 | "import" 25 | ], 26 | "raises": [ 27 | "TypeError" 28 | ] 29 | }, 30 | "new_class": { 31 | "raises": [ 32 | "TypeError" 33 | ] 34 | }, 35 | "prepare_class": { 36 | "raises": [ 37 | "TypeError" 38 | ] 39 | }, 40 | "resolve_bases": { 41 | "raises": [ 42 | "TypeError" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/urllib/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "addbase.__enter__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/urllib/robotparser.json: -------------------------------------------------------------------------------- 1 | { 2 | "RobotFileParser.can_fetch": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError" 6 | ] 7 | }, 8 | "RobotFileParser.modified": { 9 | "has": [ 10 | "import" 11 | ] 12 | }, 13 | "RuleLine.__init__": { 14 | "raises": [ 15 | "TypeError" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/uu.json: -------------------------------------------------------------------------------- 1 | { 2 | "decode": { 3 | "has": [ 4 | "read" 5 | ] 6 | }, 7 | "test": { 8 | "has": [ 9 | "import", 10 | "read", 11 | "stdout" 12 | ], 13 | "raises": [ 14 | "SystemExit" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/weakref.json: -------------------------------------------------------------------------------- 1 | { 2 | "WeakKeyDictionary.__deepcopy__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "Error" 8 | ] 9 | }, 10 | "WeakMethod.__new__": { 11 | "raises": [ 12 | "TypeError" 13 | ] 14 | }, 15 | "WeakValueDictionary.__deepcopy__": { 16 | "has": [ 17 | "import" 18 | ] 19 | }, 20 | "WeakValueDictionary.__getitem__": { 21 | "raises": [ 22 | "KeyError" 23 | ] 24 | }, 25 | "WeakValueDictionary.__init__": { 26 | "raises": [ 27 | "TypeError" 28 | ] 29 | }, 30 | "WeakValueDictionary.pop": { 31 | "raises": [ 32 | "KeyError" 33 | ] 34 | }, 35 | "WeakValueDictionary.update": { 36 | "raises": [ 37 | "TypeError" 38 | ] 39 | }, 40 | "finalize.__init__": { 41 | "has": [ 42 | "import" 43 | ], 44 | "raises": [ 45 | "TypeError" 46 | ] 47 | } 48 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/xdrlib.json: -------------------------------------------------------------------------------- 1 | { 2 | "Packer.pack_farray": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "Packer.pack_fstring": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "Packer.pack_uhyper": { 13 | "raises": [ 14 | "ConversionError" 15 | ] 16 | }, 17 | "Unpacker.done": { 18 | "raises": [ 19 | "Error" 20 | ] 21 | }, 22 | "Unpacker.unpack_double": { 23 | "raises": [ 24 | "EOFError" 25 | ] 26 | }, 27 | "Unpacker.unpack_float": { 28 | "raises": [ 29 | "EOFError" 30 | ] 31 | }, 32 | "Unpacker.unpack_fstring": { 33 | "raises": [ 34 | "EOFError", 35 | "ValueError" 36 | ] 37 | }, 38 | "Unpacker.unpack_int": { 39 | "raises": [ 40 | "EOFError" 41 | ] 42 | }, 43 | "Unpacker.unpack_uint": { 44 | "raises": [ 45 | "EOFError" 46 | ] 47 | } 48 | } -------------------------------------------------------------------------------- /deal/linter/stubs/cpython/zipapp.json: -------------------------------------------------------------------------------- 1 | { 2 | "_maybe_open": { 3 | "has": [ 4 | "read" 5 | ] 6 | }, 7 | "create_archive": { 8 | "has": [ 9 | "read" 10 | ], 11 | "raises": [ 12 | "ZipAppError" 13 | ] 14 | }, 15 | "main": { 16 | "has": [ 17 | "import", 18 | "stdout" 19 | ], 20 | "raises": [ 21 | "SystemExit", 22 | "ZipAppError" 23 | ] 24 | } 25 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/easter.json: -------------------------------------------------------------------------------- 1 | { 2 | "easter": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/parser/_parser.json: -------------------------------------------------------------------------------- 1 | { 2 | "_timelex.__init__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "_timelex.__next__": { 8 | "raises": [ 9 | "StopIteration" 10 | ] 11 | }, 12 | "_ymd._resolve_from_stridxs": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "_ymd.append": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "_ymd.resolve_ymd": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "parser._ampm_valid": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "parser._build_tzaware": { 33 | "raises": [ 34 | "RuntimeError", 35 | "TypeError", 36 | "message" 37 | ] 38 | }, 39 | "parser._build_tzinfo": { 40 | "raises": [ 41 | "TypeError" 42 | ] 43 | }, 44 | "parser._parse_numeric_token": { 45 | "raises": [ 46 | "ValueError" 47 | ] 48 | }, 49 | "parser.parse": { 50 | "raises": [ 51 | "ParserError" 52 | ] 53 | }, 54 | "parserinfo.convertyear": { 55 | "raises": [ 56 | "AssertionError" 57 | ] 58 | } 59 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/parser/isoparser.json: -------------------------------------------------------------------------------- 1 | { 2 | "isoparser.__init__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "isoparser._calculate_weekdate": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "isoparser._parse_isodate_common": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "isoparser._parse_isodate_uncommon": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "isoparser._parse_isotime": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "isoparser._parse_tzstr": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "isoparser.isoparse": { 33 | "raises": [ 34 | "ValueError" 35 | ] 36 | }, 37 | "isoparser.parse_isodate": { 38 | "raises": [ 39 | "ValueError" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/relativedelta.json: -------------------------------------------------------------------------------- 1 | { 2 | "relativedelta.__add__": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "relativedelta.__init__": { 8 | "raises": [ 9 | "RuntimeError", 10 | "TypeError", 11 | "ValueError", 12 | "message" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/rrule.json: -------------------------------------------------------------------------------- 1 | { 2 | "_rrulestr._handle_BYWEEKDAY": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "_rrulestr._handle_UNTIL": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "_rrulestr._parse_date_value": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "_rrulestr._parse_rfc": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "_rrulestr._parse_rfc_rrule": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "rrule.__construct_byset": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "rrule.__init__": { 33 | "raises": [ 34 | "RuntimeError", 35 | "TypeError", 36 | "ValueError", 37 | "message" 38 | ] 39 | }, 40 | "rrulebase.__getitem__": { 41 | "raises": [ 42 | "IndexError" 43 | ] 44 | }, 45 | "weekday.__init__": { 46 | "raises": [ 47 | "ValueError" 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/tz/_common.json: -------------------------------------------------------------------------------- 1 | { 2 | "_tzinfo._fromutc": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "tzrangebase.__init__": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | }, 12 | "tzrangebase.fromutc": { 13 | "raises": [ 14 | "TypeError", 15 | "ValueError" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/tz/tz.json: -------------------------------------------------------------------------------- 1 | { 2 | "datetime_ambiguous": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "datetime_exists": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "tzfile._read_tzfile": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "tzfile.fromutc": { 18 | "raises": [ 19 | "TypeError", 20 | "ValueError" 21 | ] 22 | }, 23 | "tzical._parse_offset": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "tzical._parse_rfc": { 29 | "raises": [ 30 | "ValueError" 31 | ] 32 | }, 33 | "tzical.get": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | }, 38 | "tzstr.__init__": { 39 | "raises": [ 40 | "ValueError" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/tz/win.json: -------------------------------------------------------------------------------- 1 | { 2 | "tzres.name_from_string": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "tzwinbase.__init__": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/dateutil/zoneinfo/__init__.json: -------------------------------------------------------------------------------- 1 | { 2 | "gettz": { 3 | "raises": [ 4 | "RuntimeError", 5 | "TypeError", 6 | "message" 7 | ] 8 | }, 9 | "gettz_db_metadata": { 10 | "raises": [ 11 | "RuntimeError", 12 | "TypeError", 13 | "message" 14 | ] 15 | }, 16 | "getzoneinfofile_stream": { 17 | "raises": [ 18 | "RuntimeError", 19 | "TypeError", 20 | "message" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/marshmallow/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "FieldABC._deserialize": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "FieldABC._serialize": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | }, 12 | "FieldABC.deserialize": { 13 | "raises": [ 14 | "NotImplementedError" 15 | ] 16 | }, 17 | "FieldABC.serialize": { 18 | "raises": [ 19 | "NotImplementedError" 20 | ] 21 | }, 22 | "SchemaABC.dump": { 23 | "raises": [ 24 | "NotImplementedError" 25 | ] 26 | }, 27 | "SchemaABC.dumps": { 28 | "raises": [ 29 | "NotImplementedError" 30 | ] 31 | }, 32 | "SchemaABC.load": { 33 | "raises": [ 34 | "NotImplementedError" 35 | ] 36 | }, 37 | "SchemaABC.loads": { 38 | "raises": [ 39 | "NotImplementedError" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /deal/linter/stubs/marshmallow/class_registry.json: -------------------------------------------------------------------------------- 1 | { 2 | "get_class": { 3 | "raises": [ 4 | "RegistryError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/marshmallow/orderedset.json: -------------------------------------------------------------------------------- 1 | { 2 | "OrderedSet.pop": { 3 | "raises": [ 4 | "KeyError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/marshmallow/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "Schema.__init__": { 3 | "raises": [ 4 | "Error", 5 | "StringNotCollectionError" 6 | ] 7 | }, 8 | "Schema._bind_field": { 9 | "raises": [ 10 | "TypeError", 11 | "error" 12 | ] 13 | }, 14 | "Schema._deserialize": { 15 | "raises": [ 16 | "ValueError" 17 | ] 18 | }, 19 | "Schema._do_load": { 20 | "raises": [ 21 | "exc" 22 | ] 23 | }, 24 | "Schema._init_fields": { 25 | "raises": [ 26 | "ValueError" 27 | ] 28 | }, 29 | "Schema._invoke_field_validators": { 30 | "raises": [ 31 | "ValueError" 32 | ] 33 | }, 34 | "SchemaOpts.__init__": { 35 | "has": [ 36 | "import" 37 | ], 38 | "raises": [ 39 | "RuntimeError", 40 | "TypeError", 41 | "ValueError", 42 | "message" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /deal/linter/stubs/marshmallow/utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "callable_or_raise": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "from_iso_date": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "from_iso_datetime": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "from_iso_time": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "pprint": { 23 | "has": [ 24 | "stdout" 25 | ] 26 | }, 27 | "resolve_field_instance": { 28 | "raises": [ 29 | "FieldInstanceResolutionError" 30 | ] 31 | }, 32 | "rfcformat": { 33 | "raises": [ 34 | "ValueError" 35 | ] 36 | }, 37 | "set_value": { 38 | "raises": [ 39 | "ValueError" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /deal/linter/stubs/marshmallow/validate.json: -------------------------------------------------------------------------------- 1 | { 2 | "ContainsNoneOf.__call__": { 3 | "raises": [ 4 | "ValidationError" 5 | ] 6 | }, 7 | "ContainsOnly.__call__": { 8 | "raises": [ 9 | "ValidationError" 10 | ] 11 | }, 12 | "Email.__call__": { 13 | "raises": [ 14 | "ValidationError" 15 | ] 16 | }, 17 | "Equal.__call__": { 18 | "raises": [ 19 | "ValidationError" 20 | ] 21 | }, 22 | "Length.__call__": { 23 | "raises": [ 24 | "ValidationError" 25 | ] 26 | }, 27 | "Length.__init__": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "OneOf.__call__": { 33 | "raises": [ 34 | "ValidationError" 35 | ] 36 | }, 37 | "Predicate.__call__": { 38 | "raises": [ 39 | "ValidationError" 40 | ] 41 | }, 42 | "Range.__call__": { 43 | "raises": [ 44 | "ValidationError" 45 | ] 46 | }, 47 | "Regexp.__call__": { 48 | "raises": [ 49 | "ValidationError" 50 | ] 51 | }, 52 | "URL.RegexMemoizer._regex_generator": { 53 | "raises": [ 54 | "TypeError", 55 | "ValueError" 56 | ] 57 | }, 58 | "URL.__call__": { 59 | "raises": [ 60 | "ValidationError" 61 | ] 62 | } 63 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/_globals.json: -------------------------------------------------------------------------------- 1 | { 2 | "_CopyMode.__bool__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/_pytesttester.json: -------------------------------------------------------------------------------- 1 | { 2 | "PytestTester.__call__": { 3 | "has": [ 4 | "import", 5 | "stdout" 6 | ], 7 | "raises": [ 8 | "AssertionError", 9 | "TypeError", 10 | "ValueError" 11 | ] 12 | }, 13 | "_show_numpy_info": { 14 | "has": [ 15 | "import", 16 | "stdout" 17 | ] 18 | } 19 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/_version.json: -------------------------------------------------------------------------------- 1 | { 2 | "git_pieces_from_vcs": { 3 | "has": [ 4 | "stdout" 5 | ], 6 | "raises": [ 7 | "AssertionError", 8 | "NotThisMethod" 9 | ] 10 | }, 11 | "git_versions_from_keywords": { 12 | "has": [ 13 | "stdout" 14 | ], 15 | "raises": [ 16 | "NotThisMethod" 17 | ] 18 | }, 19 | "render": { 20 | "raises": [ 21 | "ValueError" 22 | ] 23 | }, 24 | "run_command": { 25 | "has": [ 26 | "stdout" 27 | ], 28 | "raises": [ 29 | "AssertionError" 30 | ] 31 | }, 32 | "versions_from_parentdir": { 33 | "has": [ 34 | "stdout" 35 | ], 36 | "raises": [ 37 | "NotThisMethod", 38 | "TypeError" 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/array_api/_data_type_functions.json: -------------------------------------------------------------------------------- 1 | { 2 | "broadcast_arrays": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "broadcast_to": { 8 | "has": [ 9 | "import" 10 | ] 11 | }, 12 | "can_cast": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "result_type": { 18 | "raises": [ 19 | "TypeError", 20 | "ValueError" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/array_api/_dtypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "_result_type": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/array_api/_statistical_functions.json: -------------------------------------------------------------------------------- 1 | { 2 | "max": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "mean": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "min": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "prod": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "std": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | }, 27 | "sum": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | }, 32 | "var": { 33 | "raises": [ 34 | "TypeError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/array_api/setup.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "has": [ 4 | "import" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/conftest.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_fpu_mode": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "pytest_itemcollected": { 8 | "has": [ 9 | "global" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/__init__.json: -------------------------------------------------------------------------------- 1 | { 2 | "__getattr__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "AttributeError", 8 | "RuntimeError", 9 | "TypeError", 10 | "message" 11 | ] 12 | }, 13 | "_ufunc_reconstruct": { 14 | "has": [ 15 | "import" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_asarray.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_dtype.json: -------------------------------------------------------------------------------- 1 | { 2 | "_construction_repr": { 3 | "raises": [ 4 | "RuntimeError", 5 | "ZeroDivisionError" 6 | ] 7 | }, 8 | "_kind_name": { 9 | "raises": [ 10 | "RuntimeError" 11 | ] 12 | }, 13 | "_name_get": { 14 | "raises": [ 15 | "RuntimeError" 16 | ] 17 | }, 18 | "_scalar_str": { 19 | "raises": [ 20 | "RuntimeError", 21 | "ZeroDivisionError" 22 | ] 23 | } 24 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_dtype_ctypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from_ctypes_array": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "NotImplementedError", 8 | "TypeError" 9 | ] 10 | }, 11 | "_from_ctypes_structure": { 12 | "has": [ 13 | "import" 14 | ], 15 | "raises": [ 16 | "NotImplementedError", 17 | "TypeError" 18 | ] 19 | }, 20 | "_from_ctypes_union": { 21 | "has": [ 22 | "import" 23 | ], 24 | "raises": [ 25 | "NotImplementedError", 26 | "TypeError" 27 | ] 28 | }, 29 | "dtype_from_ctypes_type": { 30 | "has": [ 31 | "import" 32 | ], 33 | "raises": [ 34 | "NotImplementedError", 35 | "TypeError" 36 | ] 37 | } 38 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_exceptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "_UFuncBinaryResolutionError.__init__": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | }, 7 | "_display_as_base": { 8 | "raises": [ 9 | "AssertionError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_machar.json: -------------------------------------------------------------------------------- 1 | { 2 | "MachAr.__init__": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "MachAr._do_init": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_methods.json: -------------------------------------------------------------------------------- 1 | { 2 | "_clip": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "ValueError", 10 | "message" 11 | ] 12 | }, 13 | "_clip_dep_invoke_with_casting": { 14 | "has": [ 15 | "import" 16 | ], 17 | "raises": [ 18 | "RuntimeError", 19 | "TypeError", 20 | "message" 21 | ] 22 | }, 23 | "_clip_dep_is_scalar_nan": { 24 | "has": [ 25 | "import" 26 | ] 27 | }, 28 | "_count_reduce_items": { 29 | "has": [ 30 | "import" 31 | ] 32 | }, 33 | "_dump": { 34 | "has": [ 35 | "read" 36 | ] 37 | }, 38 | "_mean": { 39 | "has": [ 40 | "import" 41 | ], 42 | "raises": [ 43 | "RuntimeError", 44 | "TypeError", 45 | "message" 46 | ] 47 | }, 48 | "_var": { 49 | "has": [ 50 | "import" 51 | ], 52 | "raises": [ 53 | "RuntimeError", 54 | "TypeError", 55 | "message" 56 | ] 57 | } 58 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_type_aliases.json: -------------------------------------------------------------------------------- 1 | { 2 | "_bits_of": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "bitname": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/_ufunc_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "errstate.__enter__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "errstate.__exit__": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "setbufsize": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "seterrcall": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/arrayprint.json: -------------------------------------------------------------------------------- 1 | { 2 | "FloatingFormat.__init__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "_TimelikeFormat._format_non_nat": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | }, 12 | "_array_repr_implementation": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "_array_str_implementation": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "_make_options_dict": { 23 | "has": [ 24 | "import" 25 | ], 26 | "raises": [ 27 | "RuntimeError", 28 | "TypeError", 29 | "ValueError", 30 | "message" 31 | ] 32 | }, 33 | "_none_or_positive_arg": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | }, 38 | "array2string": { 39 | "has": [ 40 | "import" 41 | ], 42 | "raises": [ 43 | "RuntimeError", 44 | "TypeError", 45 | "ValueError", 46 | "message" 47 | ] 48 | }, 49 | "format_float_positional": { 50 | "raises": [ 51 | "ValueError" 52 | ] 53 | }, 54 | "format_float_scientific": { 55 | "raises": [ 56 | "ValueError" 57 | ] 58 | }, 59 | "set_printoptions": { 60 | "raises": [ 61 | "TypeError", 62 | "ValueError" 63 | ] 64 | } 65 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/defchararray.json: -------------------------------------------------------------------------------- 1 | { 2 | "chararray.__array_finalize__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "chararray.__mul__": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "chararray.__new__": { 13 | "has": [ 14 | "global" 15 | ] 16 | }, 17 | "chararray.__rmul__": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "chararray.isdecimal": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | }, 27 | "chararray.isnumeric": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | }, 32 | "isdecimal": { 33 | "raises": [ 34 | "TypeError" 35 | ] 36 | }, 37 | "isnumeric": { 38 | "raises": [ 39 | "TypeError" 40 | ] 41 | }, 42 | "multiply": { 43 | "raises": [ 44 | "ValueError" 45 | ] 46 | } 47 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/einsumfunc.json: -------------------------------------------------------------------------------- 1 | { 2 | "_parse_einsum_input": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError" 6 | ] 7 | }, 8 | "einsum": { 9 | "raises": [ 10 | "KeyError", 11 | "TypeError", 12 | "ValueError" 13 | ] 14 | }, 15 | "einsum_path": { 16 | "raises": [ 17 | "KeyError", 18 | "TypeError", 19 | "ValueError" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/fromnumeric.json: -------------------------------------------------------------------------------- 1 | { 2 | "put": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "resize": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "sum": { 13 | "has": [ 14 | "import" 15 | ], 16 | "raises": [ 17 | "RuntimeError", 18 | "TypeError", 19 | "message" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/function_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "_add_docstring": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "add_newdoc": { 13 | "has": [ 14 | "import" 15 | ] 16 | }, 17 | "geomspace": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "linspace": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "logspace": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/getlimits.json: -------------------------------------------------------------------------------- 1 | { 2 | "MachArLike.smallest_subnormal": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "_get_machar": { 13 | "has": [ 14 | "import" 15 | ], 16 | "raises": [ 17 | "RuntimeError", 18 | "TypeError", 19 | "ValueError", 20 | "message" 21 | ] 22 | }, 23 | "_register_known_types": { 24 | "raises": [ 25 | "ZeroDivisionError" 26 | ] 27 | }, 28 | "finfo.__new__": { 29 | "raises": [ 30 | "ValueError" 31 | ] 32 | }, 33 | "finfo._init": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | }, 38 | "finfo.machar": { 39 | "has": [ 40 | "import" 41 | ], 42 | "raises": [ 43 | "RuntimeError", 44 | "TypeError", 45 | "message" 46 | ] 47 | }, 48 | "finfo.smallest_normal": { 49 | "has": [ 50 | "import" 51 | ], 52 | "raises": [ 53 | "RuntimeError", 54 | "TypeError", 55 | "message" 56 | ] 57 | }, 58 | "iinfo.__init__": { 59 | "raises": [ 60 | "ValueError" 61 | ] 62 | } 63 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/memmap.json: -------------------------------------------------------------------------------- 1 | { 2 | "memmap.__new__": { 3 | "has": [ 4 | "import", 5 | "read" 6 | ], 7 | "raises": [ 8 | "TypeError", 9 | "ValueError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/numeric.json: -------------------------------------------------------------------------------- 1 | { 2 | "base_repr": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "binary_repr": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "message" 15 | ] 16 | }, 17 | "convolve": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "cross": { 23 | "raises": [ 24 | "AssertionError", 25 | "ValueError" 26 | ] 27 | }, 28 | "identity": { 29 | "has": [ 30 | "import" 31 | ] 32 | }, 33 | "moveaxis": { 34 | "raises": [ 35 | "AxisError", 36 | "ValueError" 37 | ] 38 | }, 39 | "normalize_axis_tuple": { 40 | "raises": [ 41 | "ValueError" 42 | ] 43 | }, 44 | "roll": { 45 | "raises": [ 46 | "AxisError", 47 | "ValueError" 48 | ] 49 | }, 50 | "rollaxis": { 51 | "raises": [ 52 | "AxisError" 53 | ] 54 | }, 55 | "tensordot": { 56 | "raises": [ 57 | "ValueError" 58 | ] 59 | } 60 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/numerictypes.json: -------------------------------------------------------------------------------- 1 | { 2 | "sctype2char": { 3 | "raises": [ 4 | "KeyError", 5 | "ValueError" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/overrides.json: -------------------------------------------------------------------------------- 1 | { 2 | "array_function_dispatch": { 3 | "raises": [ 4 | "RuntimeError" 5 | ] 6 | }, 7 | "verify_matching_signatures": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/setup_common.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_api_version": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "check_for_right_shift_internal_compiler_error": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | }, 17 | "check_long_double_representation": { 18 | "has": [ 19 | "read" 20 | ], 21 | "raises": [ 22 | "ValueError" 23 | ] 24 | }, 25 | "get_api_versions": { 26 | "has": [ 27 | "import" 28 | ] 29 | }, 30 | "long_double_representation": { 31 | "raises": [ 32 | "Error", 33 | "ValueError" 34 | ] 35 | }, 36 | "pyod": { 37 | "has": [ 38 | "read" 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/core/shape_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "_arrays_for_stack_dispatcher": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "_block_check_depths_match": { 13 | "raises": [ 14 | "TypeError", 15 | "ValueError" 16 | ] 17 | }, 18 | "_block_info_recursion": { 19 | "raises": [ 20 | "TypeError", 21 | "ValueError" 22 | ] 23 | }, 24 | "_block_setup": { 25 | "raises": [ 26 | "TypeError", 27 | "ValueError" 28 | ] 29 | }, 30 | "_concatenate_shapes": { 31 | "raises": [ 32 | "ValueError" 33 | ] 34 | }, 35 | "block": { 36 | "raises": [ 37 | "ValueError" 38 | ] 39 | }, 40 | "stack": { 41 | "raises": [ 42 | "ValueError" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/ctypeslib.json: -------------------------------------------------------------------------------- 1 | { 2 | "_ndptr.from_param": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "ndpointer": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/dual.json: -------------------------------------------------------------------------------- 1 | { 2 | "register_func": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "restore_all": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "restore_func": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/_iotools.json: -------------------------------------------------------------------------------- 1 | { 2 | "NameValidator.__init__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "StringConverter.__init__": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "StringConverter._do_upgrade": { 13 | "raises": [ 14 | "ConverterError", 15 | "ConverterLockError" 16 | ] 17 | }, 18 | "StringConverter._find_map_entry": { 19 | "raises": [ 20 | "LookupError" 21 | ] 22 | }, 23 | "StringConverter._strict_call": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "StringConverter.update": { 29 | "raises": [ 30 | "TypeError" 31 | ] 32 | }, 33 | "str2bool": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | } 38 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/_version.json: -------------------------------------------------------------------------------- 1 | { 2 | "NumpyVersion.__init__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "NumpyVersion._compare": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/arraypad.json: -------------------------------------------------------------------------------- 1 | { 2 | "_as_pairs": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "_get_stats": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "pad": { 13 | "raises": [ 14 | "TypeError", 15 | "ValueError" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/arraysetops.json: -------------------------------------------------------------------------------- 1 | { 2 | "ediff1d": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "intersect1d": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "setdiff1d": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "setxor1d": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "union1d": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | }, 27 | "unique": { 28 | "raises": [ 29 | "TypeError" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/arrayterator.json: -------------------------------------------------------------------------------- 1 | { 2 | "Arrayterator.__iter__": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/index_tricks.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxisConcatenator.__getitem__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "diag_indices_from": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "fill_diagonal": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "ix_": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "ndindex.ndincr": { 23 | "has": [ 24 | "import" 25 | ], 26 | "raises": [ 27 | "RuntimeError", 28 | "TypeError", 29 | "message" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/polynomial.json: -------------------------------------------------------------------------------- 1 | { 2 | "poly": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "poly1d.__init__": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "ValueError", 15 | "message" 16 | ] 17 | }, 18 | "poly1d.__pow__": { 19 | "raises": [ 20 | "ValueError" 21 | ] 22 | }, 23 | "poly1d.__setitem__": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "poly1d.coeffs": { 29 | "raises": [ 30 | "AttributeError" 31 | ] 32 | }, 33 | "poly1d.deriv": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | }, 38 | "poly1d.integ": { 39 | "raises": [ 40 | "ValueError" 41 | ] 42 | }, 43 | "poly1d.roots": { 44 | "raises": [ 45 | "ValueError" 46 | ] 47 | }, 48 | "polyder": { 49 | "raises": [ 50 | "ValueError" 51 | ] 52 | }, 53 | "polyfit": { 54 | "has": [ 55 | "import" 56 | ], 57 | "raises": [ 58 | "RuntimeError", 59 | "TypeError", 60 | "ValueError", 61 | "message" 62 | ] 63 | }, 64 | "polyint": { 65 | "raises": [ 66 | "ValueError" 67 | ] 68 | }, 69 | "roots": { 70 | "raises": [ 71 | "ValueError" 72 | ] 73 | } 74 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/recfunctions.json: -------------------------------------------------------------------------------- 1 | { 2 | "append_fields": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "apply_along_fields": { 8 | "raises": [ 9 | "NotImplementedError", 10 | "ValueError" 11 | ] 12 | }, 13 | "join_by": { 14 | "raises": [ 15 | "ValueError" 16 | ] 17 | }, 18 | "rec_append_fields": { 19 | "raises": [ 20 | "ValueError" 21 | ] 22 | }, 23 | "rec_join": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "stack_arrays": { 29 | "raises": [ 30 | "TypeError" 31 | ] 32 | }, 33 | "structured_to_unstructured": { 34 | "raises": [ 35 | "NotImplementedError", 36 | "ValueError" 37 | ] 38 | }, 39 | "unstructured_to_structured": { 40 | "raises": [ 41 | "NotImplementedError", 42 | "ValueError" 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/setup.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "has": [ 4 | "import" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/shape_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "_make_along_axis_idx": { 3 | "raises": [ 4 | "IndexError", 5 | "ValueError" 6 | ] 7 | }, 8 | "apply_along_axis": { 9 | "raises": [ 10 | "ValueError" 11 | ] 12 | }, 13 | "apply_over_axes": { 14 | "raises": [ 15 | "ValueError" 16 | ] 17 | }, 18 | "array_split": { 19 | "raises": [ 20 | "ValueError" 21 | ] 22 | }, 23 | "dsplit": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "hsplit": { 29 | "raises": [ 30 | "ValueError" 31 | ] 32 | }, 33 | "put_along_axis": { 34 | "raises": [ 35 | "IndexError", 36 | "ValueError" 37 | ] 38 | }, 39 | "split": { 40 | "raises": [ 41 | "ValueError" 42 | ] 43 | }, 44 | "take_along_axis": { 45 | "raises": [ 46 | "IndexError", 47 | "ValueError" 48 | ] 49 | }, 50 | "vsplit": { 51 | "raises": [ 52 | "ValueError" 53 | ] 54 | } 55 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/stride_tricks.json: -------------------------------------------------------------------------------- 1 | { 2 | "_broadcast_shape": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "_broadcast_to": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "broadcast_arrays": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "broadcast_to": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "sliding_window_view": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/twodim_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "diag": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "fliplr": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "flipud": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "histogram2d": { 18 | "has": [ 19 | "import" 20 | ], 21 | "raises": [ 22 | "ValueError" 23 | ] 24 | }, 25 | "tril_indices_from": { 26 | "raises": [ 27 | "ValueError" 28 | ] 29 | }, 30 | "triu_indices_from": { 31 | "raises": [ 32 | "ValueError" 33 | ] 34 | }, 35 | "vander": { 36 | "raises": [ 37 | "ValueError" 38 | ] 39 | } 40 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/type_check.json: -------------------------------------------------------------------------------- 1 | { 2 | "_getmaxmin": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "common_type": { 8 | "raises": [ 9 | "TypeError" 10 | ] 11 | }, 12 | "nan_to_num": { 13 | "has": [ 14 | "import" 15 | ] 16 | }, 17 | "real_if_close": { 18 | "has": [ 19 | "import" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/ufunclike.json: -------------------------------------------------------------------------------- 1 | { 2 | "_deprecate_out_named_y": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "_fix_and_maybe_deprecate_out_named_y": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "isneginf": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "isposinf": { 23 | "raises": [ 24 | "TypeError" 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/user_array.json: -------------------------------------------------------------------------------- 1 | { 2 | "container._scalarfunc": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/lib/utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "_Deprecate.__call__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "_getmembers": { 13 | "has": [ 14 | "import" 15 | ] 16 | }, 17 | "_lookfor_generate_cache": { 18 | "has": [ 19 | "import" 20 | ], 21 | "raises": [ 22 | "TypeError" 23 | ] 24 | }, 25 | "_makenamedict": { 26 | "has": [ 27 | "import" 28 | ] 29 | }, 30 | "_opt_info": { 31 | "has": [ 32 | "import" 33 | ] 34 | }, 35 | "get_include": { 36 | "has": [ 37 | "import" 38 | ], 39 | "raises": [ 40 | "TypeError" 41 | ] 42 | }, 43 | "info": { 44 | "has": [ 45 | "global", 46 | "import" 47 | ] 48 | }, 49 | "lookfor": { 50 | "has": [ 51 | "import", 52 | "stdout" 53 | ], 54 | "raises": [ 55 | "FileExistsError", 56 | "ZeroDivisionError" 57 | ] 58 | }, 59 | "safe_eval": { 60 | "has": [ 61 | "import" 62 | ], 63 | "raises": [ 64 | "AssertionError" 65 | ] 66 | }, 67 | "source": { 68 | "has": [ 69 | "import" 70 | ] 71 | }, 72 | "who": { 73 | "has": [ 74 | "stdout" 75 | ] 76 | } 77 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/linalg/setup.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "has": [ 4 | "import", 5 | "stdout" 6 | ], 7 | "raises": [ 8 | "TypeError" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/ma/bench.json: -------------------------------------------------------------------------------- 1 | { 2 | "compare_functions_1v": { 3 | "has": [ 4 | "stdout" 5 | ], 6 | "raises": [ 7 | "ZeroDivisionError" 8 | ] 9 | }, 10 | "compare_functions_2v": { 11 | "has": [ 12 | "stdout" 13 | ], 14 | "raises": [ 15 | "ZeroDivisionError" 16 | ] 17 | }, 18 | "compare_methods": { 19 | "has": [ 20 | "stdout" 21 | ], 22 | "raises": [ 23 | "ZeroDivisionError" 24 | ] 25 | }, 26 | "timer": { 27 | "has": [ 28 | "stdout" 29 | ], 30 | "raises": [ 31 | "ZeroDivisionError" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/ma/mrecords.json: -------------------------------------------------------------------------------- 1 | { 2 | "MaskedRecords.__getattribute__": { 3 | "raises": [ 4 | "AttributeError", 5 | "NotImplementedError" 6 | ] 7 | }, 8 | "MaskedRecords.__new__": { 9 | "raises": [ 10 | "MAError" 11 | ] 12 | }, 13 | "MaskedRecords.__setattr__": { 14 | "raises": [ 15 | "AttributeError" 16 | ] 17 | }, 18 | "_checknames": { 19 | "raises": [ 20 | "NameError" 21 | ] 22 | }, 23 | "_guessvartypes": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "fromtextfile": { 29 | "has": [ 30 | "import" 31 | ], 32 | "raises": [ 33 | "FileNotFoundError", 34 | "NotImplementedError", 35 | "RuntimeError", 36 | "TypeError", 37 | "ValueError", 38 | "message" 39 | ] 40 | }, 41 | "openfile": { 42 | "raises": [ 43 | "FileNotFoundError", 44 | "NotImplementedError" 45 | ] 46 | } 47 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/ma/setup.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "has": [ 4 | "import" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/ma/testutils.json: -------------------------------------------------------------------------------- 1 | { 2 | "_assert_equal_on_sequences": { 3 | "raises": [ 4 | "AssertionError", 5 | "ValueError" 6 | ] 7 | }, 8 | "assert_almost_equal": { 9 | "raises": [ 10 | "AssertionError" 11 | ] 12 | }, 13 | "assert_array_almost_equal": { 14 | "raises": [ 15 | "ValueError" 16 | ] 17 | }, 18 | "assert_array_approx_equal": { 19 | "raises": [ 20 | "ValueError" 21 | ] 22 | }, 23 | "assert_array_compare": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "assert_array_equal": { 29 | "raises": [ 30 | "ValueError" 31 | ] 32 | }, 33 | "assert_array_less": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | }, 38 | "assert_equal": { 39 | "raises": [ 40 | "AssertionError", 41 | "ValueError" 42 | ] 43 | }, 44 | "assert_equal_records": { 45 | "raises": [ 46 | "AssertionError", 47 | "ValueError" 48 | ] 49 | }, 50 | "fail_if_array_equal": { 51 | "raises": [ 52 | "ValueError" 53 | ] 54 | }, 55 | "fail_if_equal": { 56 | "raises": [ 57 | "AssertionError" 58 | ] 59 | } 60 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/ma/timer_comparison.json: -------------------------------------------------------------------------------- 1 | { 2 | "ModuleTester.assert_array_compare": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "ModuleTester.test_0": { 8 | "raises": [ 9 | "ZeroDivisionError" 10 | ] 11 | }, 12 | "ModuleTester.test_1": { 13 | "raises": [ 14 | "AssertionError", 15 | "TypeError", 16 | "ZeroDivisionError" 17 | ] 18 | }, 19 | "ModuleTester.test_2": { 20 | "raises": [ 21 | "AssertionError" 22 | ] 23 | }, 24 | "ModuleTester.test_3": { 25 | "raises": [ 26 | "AssertionError" 27 | ] 28 | }, 29 | "ModuleTester.test_4": { 30 | "raises": [ 31 | "AssertionError" 32 | ] 33 | }, 34 | "ModuleTester.test_5": { 35 | "raises": [ 36 | "AssertionError", 37 | "ZeroDivisionError" 38 | ] 39 | }, 40 | "ModuleTester.test_6": { 41 | "raises": [ 42 | "AssertionError" 43 | ] 44 | }, 45 | "ModuleTester.test_7": { 46 | "raises": [ 47 | "ZeroDivisionError" 48 | ] 49 | }, 50 | "ModuleTester.test_99": { 51 | "raises": [ 52 | "AssertionError", 53 | "ZeroDivisionError" 54 | ] 55 | } 56 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/__init__.json: -------------------------------------------------------------------------------- 1 | { 2 | "set_default_printstyle": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "ValueError" 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/_polybase.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABCPolyBase.__format__": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "ABCPolyBase.__init__": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "ABCPolyBase.__truediv__": { 13 | "raises": [ 14 | "TypeError" 15 | ] 16 | }, 17 | "ABCPolyBase._get_coefficients": { 18 | "raises": [ 19 | "TypeError" 20 | ] 21 | }, 22 | "ABCPolyBase._repr_latex_term": { 23 | "raises": [ 24 | "NotImplementedError" 25 | ] 26 | }, 27 | "ABCPolyBase._str_term_ascii": { 28 | "raises": [ 29 | "NotImplementedError" 30 | ] 31 | }, 32 | "ABCPolyBase._str_term_unicode": { 33 | "raises": [ 34 | "NotImplementedError" 35 | ] 36 | }, 37 | "ABCPolyBase.basis": { 38 | "raises": [ 39 | "ValueError" 40 | ] 41 | }, 42 | "ABCPolyBase.truncate": { 43 | "raises": [ 44 | "ValueError" 45 | ] 46 | } 47 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/hermite.json: -------------------------------------------------------------------------------- 1 | { 2 | "herm2poly": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "hermcompanion": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "hermder": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "hermgauss": { 18 | "raises": [ 19 | "ValueError", 20 | "ZeroDivisionError" 21 | ] 22 | }, 23 | "hermint": { 24 | "raises": [ 25 | "ValueError", 26 | "ZeroDivisionError" 27 | ] 28 | }, 29 | "hermline": { 30 | "raises": [ 31 | "ZeroDivisionError" 32 | ] 33 | }, 34 | "hermmul": { 35 | "raises": [ 36 | "ZeroDivisionError" 37 | ] 38 | }, 39 | "hermmulx": { 40 | "raises": [ 41 | "ZeroDivisionError" 42 | ] 43 | }, 44 | "hermroots": { 45 | "raises": [ 46 | "ValueError" 47 | ] 48 | }, 49 | "hermvander": { 50 | "raises": [ 51 | "ValueError" 52 | ] 53 | }, 54 | "poly2herm": { 55 | "raises": [ 56 | "ZeroDivisionError" 57 | ] 58 | } 59 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/hermite_e.json: -------------------------------------------------------------------------------- 1 | { 2 | "herme2poly": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "hermecompanion": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "hermeder": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "hermegauss": { 18 | "raises": [ 19 | "ValueError", 20 | "ZeroDivisionError" 21 | ] 22 | }, 23 | "hermeint": { 24 | "raises": [ 25 | "ValueError" 26 | ] 27 | }, 28 | "hermeroots": { 29 | "raises": [ 30 | "ValueError" 31 | ] 32 | }, 33 | "hermevander": { 34 | "raises": [ 35 | "ValueError" 36 | ] 37 | } 38 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/laguerre.json: -------------------------------------------------------------------------------- 1 | { 2 | "lag2poly": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "lagcompanion": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "lagder": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "laggauss": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "lagint": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "lagroots": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "lagvander": { 33 | "raises": [ 34 | "ValueError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/legendre.json: -------------------------------------------------------------------------------- 1 | { 2 | "leg2poly": { 3 | "has": [ 4 | "import" 5 | ] 6 | }, 7 | "legcompanion": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "legder": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "leggauss": { 18 | "raises": [ 19 | "ValueError", 20 | "ZeroDivisionError" 21 | ] 22 | }, 23 | "legint": { 24 | "raises": [ 25 | "ValueError", 26 | "ZeroDivisionError" 27 | ] 28 | }, 29 | "legroots": { 30 | "raises": [ 31 | "ValueError" 32 | ] 33 | }, 34 | "legvander": { 35 | "raises": [ 36 | "ValueError" 37 | ] 38 | } 39 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/polynomial.json: -------------------------------------------------------------------------------- 1 | { 2 | "polycompanion": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "polyder": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "polydiv": { 13 | "raises": [ 14 | "ZeroDivisionError" 15 | ] 16 | }, 17 | "polyint": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "polyroots": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "polyvalfromroots": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "polyvander": { 33 | "raises": [ 34 | "ValueError" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/polyutils.json: -------------------------------------------------------------------------------- 1 | { 2 | "_add": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "_deprecate_as_int": { 8 | "has": [ 9 | "import" 10 | ], 11 | "raises": [ 12 | "RuntimeError", 13 | "TypeError", 14 | "message" 15 | ] 16 | }, 17 | "_div": { 18 | "raises": [ 19 | "ValueError", 20 | "ZeroDivisionError" 21 | ] 22 | }, 23 | "_fit": { 24 | "has": [ 25 | "import" 26 | ], 27 | "raises": [ 28 | "RuntimeError", 29 | "TypeError", 30 | "ValueError", 31 | "message" 32 | ] 33 | }, 34 | "_fromroots": { 35 | "raises": [ 36 | "ValueError" 37 | ] 38 | }, 39 | "_pow": { 40 | "raises": [ 41 | "ValueError" 42 | ] 43 | }, 44 | "_sub": { 45 | "raises": [ 46 | "ValueError" 47 | ] 48 | }, 49 | "_valnd": { 50 | "raises": [ 51 | "ValueError" 52 | ] 53 | }, 54 | "_vander_nd": { 55 | "raises": [ 56 | "TypeError", 57 | "ValueError" 58 | ] 59 | }, 60 | "_vander_nd_flat": { 61 | "raises": [ 62 | "ValueError" 63 | ] 64 | }, 65 | "as_series": { 66 | "raises": [ 67 | "ValueError" 68 | ] 69 | }, 70 | "getdomain": { 71 | "raises": [ 72 | "ValueError" 73 | ] 74 | }, 75 | "trimcoef": { 76 | "raises": [ 77 | "ValueError" 78 | ] 79 | } 80 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/polynomial/setup.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "has": [ 4 | "import" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/numpy/setup.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "has": [ 4 | "import" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/pytz/__init__.json: -------------------------------------------------------------------------------- 1 | { 2 | "UTC.localize": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "UTC.normalize": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | }, 12 | "_CountryNameDict._fill": { 13 | "raises": [ 14 | "ValueError" 15 | ] 16 | }, 17 | "_CountryTimezoneDict._fill": { 18 | "raises": [ 19 | "ValueError" 20 | ] 21 | }, 22 | "_FixedOffset.__init__": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "_FixedOffset.localize": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "_FixedOffset.normalize": { 33 | "raises": [ 34 | "ValueError" 35 | ] 36 | }, 37 | "_test": { 38 | "raises": [ 39 | "TypeError" 40 | ] 41 | }, 42 | "open_resource": { 43 | "raises": [ 44 | "ValueError" 45 | ] 46 | }, 47 | "timezone": { 48 | "raises": [ 49 | "UnknownTimeZoneError", 50 | "ValueError" 51 | ] 52 | } 53 | } -------------------------------------------------------------------------------- /deal/linter/stubs/pytz/reference.json: -------------------------------------------------------------------------------- 1 | { 2 | "USTimeZone.dst": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/pytz/tzfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "build_tzinfo": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/pytz/tzinfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "DstTzInfo.fromutc": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "DstTzInfo.localize": { 8 | "raises": [ 9 | "AmbiguousTimeError", 10 | "AssertionError", 11 | "NonExistentTimeError", 12 | "ValueError" 13 | ] 14 | }, 15 | "DstTzInfo.normalize": { 16 | "raises": [ 17 | "ValueError" 18 | ] 19 | }, 20 | "StaticTzInfo.fromutc": { 21 | "raises": [ 22 | "ValueError" 23 | ] 24 | }, 25 | "StaticTzInfo.localize": { 26 | "raises": [ 27 | "ValueError" 28 | ] 29 | }, 30 | "StaticTzInfo.normalize": { 31 | "raises": [ 32 | "ValueError" 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/__init__.json: -------------------------------------------------------------------------------- 1 | { 2 | "_check_cryptography": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "RuntimeError", 8 | "TypeError", 9 | "message" 10 | ] 11 | }, 12 | "check_compatibility": { 13 | "raises": [ 14 | "AssertionError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/_internal_utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicode_is_ascii": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/adapters.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseAdapter.close": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "BaseAdapter.send": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | }, 12 | "HTTPAdapter.cert_verify": { 13 | "raises": [ 14 | "OSError" 15 | ] 16 | }, 17 | "HTTPAdapter.get_connection": { 18 | "raises": [ 19 | "InvalidProxyURL" 20 | ] 21 | }, 22 | "HTTPAdapter.proxy_manager_for": { 23 | "raises": [ 24 | "InvalidSchema" 25 | ] 26 | }, 27 | "HTTPAdapter.send": { 28 | "raises": [ 29 | "ConnectTimeout", 30 | "ConnectionError", 31 | "InvalidURL", 32 | "ProxyError", 33 | "ReadTimeout", 34 | "RetryError", 35 | "SSLError", 36 | "ValueError" 37 | ] 38 | } 39 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "AuthBase.__call__": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "HTTPDigestAuth.handle_401": { 8 | "raises": [ 9 | "TypeError", 10 | "ValueError" 11 | ] 12 | }, 13 | "_basic_auth_str": { 14 | "has": [ 15 | "import" 16 | ], 17 | "raises": [ 18 | "RuntimeError", 19 | "TypeError", 20 | "message" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/cookies.json: -------------------------------------------------------------------------------- 1 | { 2 | "MockRequest.add_header": { 3 | "raises": [ 4 | "NotImplementedError" 5 | ] 6 | }, 7 | "RequestsCookieJar._find": { 8 | "raises": [ 9 | "KeyError" 10 | ] 11 | }, 12 | "RequestsCookieJar._find_no_duplicates": { 13 | "raises": [ 14 | "CookieConflictError", 15 | "KeyError" 16 | ] 17 | }, 18 | "RequestsCookieJar.set": { 19 | "raises": [ 20 | "TypeError" 21 | ] 22 | }, 23 | "RequestsCookieJar.update": { 24 | "raises": [ 25 | "Error" 26 | ] 27 | }, 28 | "_copy_cookie_jar": { 29 | "raises": [ 30 | "Error" 31 | ] 32 | }, 33 | "cookiejar_from_dict": { 34 | "raises": [ 35 | "TypeError" 36 | ] 37 | }, 38 | "create_cookie": { 39 | "raises": [ 40 | "TypeError" 41 | ] 42 | }, 43 | "merge_cookies": { 44 | "raises": [ 45 | "ValueError" 46 | ] 47 | }, 48 | "morsel_to_cookie": { 49 | "raises": [ 50 | "TypeError" 51 | ] 52 | } 53 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/help.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": { 3 | "has": [ 4 | "stdout" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/models.json: -------------------------------------------------------------------------------- 1 | { 2 | "PreparedRequest._get_idna_encoded_host": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "UnicodeError" 8 | ] 9 | }, 10 | "PreparedRequest.prepare_body": { 11 | "raises": [ 12 | "NotImplementedError", 13 | "ValueError" 14 | ] 15 | }, 16 | "PreparedRequest.prepare_url": { 17 | "raises": [ 18 | "InvalidURL", 19 | "MissingSchema" 20 | ] 21 | }, 22 | "RequestEncodingMixin._encode_files": { 23 | "raises": [ 24 | "ValueError" 25 | ] 26 | }, 27 | "RequestHooksMixin.register_hook": { 28 | "raises": [ 29 | "ValueError" 30 | ] 31 | }, 32 | "Response.content": { 33 | "raises": [ 34 | "RuntimeError" 35 | ] 36 | }, 37 | "Response.iter_content": { 38 | "raises": [ 39 | "ChunkedEncodingError", 40 | "ConnectionError", 41 | "ContentDecodingError", 42 | "StreamConsumedError", 43 | "TypeError" 44 | ] 45 | }, 46 | "Response.raise_for_status": { 47 | "raises": [ 48 | "HTTPError" 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/sessions.json: -------------------------------------------------------------------------------- 1 | { 2 | "Session.get_adapter": { 3 | "raises": [ 4 | "InvalidSchema" 5 | ] 6 | }, 7 | "Session.send": { 8 | "raises": [ 9 | "ValueError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/status_codes.json: -------------------------------------------------------------------------------- 1 | { 2 | "_init": { 3 | "has": [ 4 | "global" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/requests/utils.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_header_validity": { 3 | "raises": [ 4 | "InvalidHeader" 5 | ] 6 | }, 7 | "extract_zipped_paths": { 8 | "has": [ 9 | "global" 10 | ], 11 | "raises": [ 12 | "TypeError" 13 | ] 14 | }, 15 | "from_key_val_list": { 16 | "raises": [ 17 | "ValueError" 18 | ] 19 | }, 20 | "get_encodings_from_content": { 21 | "has": [ 22 | "import" 23 | ], 24 | "raises": [ 25 | "RuntimeError", 26 | "TypeError", 27 | "ValueError", 28 | "message" 29 | ] 30 | }, 31 | "get_unicode_from_response": { 32 | "has": [ 33 | "import" 34 | ], 35 | "raises": [ 36 | "RuntimeError", 37 | "TypeError", 38 | "message" 39 | ] 40 | }, 41 | "guess_filename": { 42 | "raises": [ 43 | "TypeError" 44 | ] 45 | }, 46 | "rewind_body": { 47 | "raises": [ 48 | "UnrewindableBodyError" 49 | ] 50 | }, 51 | "super_len": { 52 | "has": [ 53 | "import" 54 | ], 55 | "raises": [ 56 | "RuntimeError", 57 | "TypeError", 58 | "message" 59 | ] 60 | }, 61 | "to_key_val_list": { 62 | "raises": [ 63 | "ValueError" 64 | ] 65 | }, 66 | "unquote_unreserved": { 67 | "raises": [ 68 | "InvalidURL" 69 | ] 70 | } 71 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/__init__.json: -------------------------------------------------------------------------------- 1 | { 2 | "disable_warnings": { 3 | "raises": [ 4 | "AssertionError" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/_collections.json: -------------------------------------------------------------------------------- 1 | { 2 | "HTTPHeaderDict.extend": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "HTTPHeaderDict.from_httplib": { 8 | "raises": [ 9 | "InvalidHeader" 10 | ] 11 | }, 12 | "RecentlyUsedContainer.__iter__": { 13 | "raises": [ 14 | "NotImplementedError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/connection.json: -------------------------------------------------------------------------------- 1 | { 2 | "HTTPConnection._new_conn": { 3 | "raises": [ 4 | "ConnectTimeoutError", 5 | "NewConnectionError" 6 | ] 7 | }, 8 | "HTTPConnection.putrequest": { 9 | "raises": [ 10 | "ValueError" 11 | ] 12 | }, 13 | "HTTPSConnection.connect": { 14 | "has": [ 15 | "import" 16 | ], 17 | "raises": [ 18 | "RuntimeError", 19 | "TypeError", 20 | "message" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/connectionpool.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionPool.__init__": { 3 | "raises": [ 4 | "LocationValueError" 5 | ] 6 | }, 7 | "HTTPConnectionPool._get_conn": { 8 | "raises": [ 9 | "ClosedPoolError", 10 | "EmptyPoolError" 11 | ] 12 | }, 13 | "HTTPConnectionPool._make_request": { 14 | "raises": [ 15 | "ReadTimeoutError" 16 | ] 17 | }, 18 | "HTTPConnectionPool._raise_timeout": { 19 | "raises": [ 20 | "ReadTimeoutError" 21 | ] 22 | }, 23 | "HTTPConnectionPool.urlopen": { 24 | "raises": [ 25 | "HostChangedError" 26 | ] 27 | }, 28 | "HTTPSConnectionPool._new_conn": { 29 | "raises": [ 30 | "SSLError" 31 | ] 32 | }, 33 | "HTTPSConnectionPool._validate_conn": { 34 | "has": [ 35 | "import" 36 | ], 37 | "raises": [ 38 | "RuntimeError", 39 | "TypeError", 40 | "message" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/contrib/appengine.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppEngineManager.__init__": { 3 | "has": [ 4 | "import" 5 | ], 6 | "raises": [ 7 | "AppEnginePlatformError", 8 | "RuntimeError", 9 | "TypeError", 10 | "message" 11 | ] 12 | }, 13 | "AppEngineManager._get_absolute_timeout": { 14 | "has": [ 15 | "import" 16 | ], 17 | "raises": [ 18 | "RuntimeError", 19 | "TypeError", 20 | "message" 21 | ] 22 | }, 23 | "AppEngineManager._get_retries": { 24 | "has": [ 25 | "import" 26 | ], 27 | "raises": [ 28 | "RuntimeError", 29 | "TypeError", 30 | "message" 31 | ] 32 | }, 33 | "AppEngineManager.urlopen": { 34 | "raises": [ 35 | "AppEnginePlatformError", 36 | "MaxRetryError", 37 | "ProtocolError", 38 | "SSLError", 39 | "TimeoutError" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/contrib/ntlmpool.json: -------------------------------------------------------------------------------- 1 | { 2 | "NTLMConnectionPool._new_conn": { 3 | "raises": [ 4 | "Exception" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/contrib/pyopenssl.json: -------------------------------------------------------------------------------- 1 | { 2 | "WrappedSocket.getpeercert": { 3 | "raises": [ 4 | "AssertionError", 5 | "ValueError" 6 | ] 7 | }, 8 | "WrappedSocket.recv": { 9 | "raises": [ 10 | "SocketError" 11 | ] 12 | }, 13 | "WrappedSocket.recv_into": { 14 | "raises": [ 15 | "SocketError" 16 | ] 17 | }, 18 | "_dnsname_to_stdlib": { 19 | "has": [ 20 | "import" 21 | ] 22 | }, 23 | "_validate_dependencies_met": { 24 | "has": [ 25 | "import" 26 | ], 27 | "raises": [ 28 | "ImportError" 29 | ] 30 | }, 31 | "inject_into_urllib3": { 32 | "has": [ 33 | "import" 34 | ], 35 | "raises": [ 36 | "ImportError" 37 | ] 38 | } 39 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/contrib/securetransport.json: -------------------------------------------------------------------------------- 1 | { 2 | "SecureTransportContext.load_verify_locations": { 3 | "has": [ 4 | "read" 5 | ], 6 | "raises": [ 7 | "ValueError" 8 | ] 9 | }, 10 | "SecureTransportContext.set_ciphers": { 11 | "raises": [ 12 | "ValueError" 13 | ] 14 | }, 15 | "SecureTransportContext.wrap_socket": { 16 | "raises": [ 17 | "AssertionError" 18 | ] 19 | }, 20 | "WrappedSocket._custom_validate": { 21 | "has": [ 22 | "read" 23 | ] 24 | }, 25 | "WrappedSocket._raise_on_error": { 26 | "raises": [ 27 | "exception" 28 | ] 29 | }, 30 | "WrappedSocket.getpeercert": { 31 | "raises": [ 32 | "ValueError" 33 | ] 34 | }, 35 | "WrappedSocket.recv": { 36 | "raises": [ 37 | "TypeError" 38 | ] 39 | } 40 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/contrib/socks.json: -------------------------------------------------------------------------------- 1 | { 2 | "SOCKSConnection._new_conn": { 3 | "raises": [ 4 | "ConnectTimeoutError", 5 | "NewConnectionError" 6 | ] 7 | }, 8 | "SOCKSProxyManager.__init__": { 9 | "raises": [ 10 | "ValueError" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/fields.json: -------------------------------------------------------------------------------- 1 | { 2 | "_replace_multiple": { 3 | "raises": [ 4 | "TypeError", 5 | "ValueError" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/poolmanager.json: -------------------------------------------------------------------------------- 1 | { 2 | "PoolManager.connection_from_host": { 3 | "raises": [ 4 | "LocationValueError" 5 | ] 6 | }, 7 | "ProxyManager.__init__": { 8 | "raises": [ 9 | "ProxySchemeUnknown" 10 | ] 11 | }, 12 | "ProxyManager._validate_proxy_scheme_url_selection": { 13 | "has": [ 14 | "import" 15 | ], 16 | "raises": [ 17 | "ProxySchemeUnsupported", 18 | "RuntimeError", 19 | "TypeError", 20 | "message" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/request.json: -------------------------------------------------------------------------------- 1 | { 2 | "RequestMethods.request_encode_body": { 3 | "raises": [ 4 | "TypeError" 5 | ] 6 | }, 7 | "RequestMethods.urlopen": { 8 | "raises": [ 9 | "NotImplementedError" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "HTTPResponse._decode": { 3 | "raises": [ 4 | "DecodeError" 5 | ] 6 | }, 7 | "HTTPResponse.fileno": { 8 | "raises": [ 9 | "OSError" 10 | ] 11 | }, 12 | "HTTPResponse.read": { 13 | "raises": [ 14 | "IncompleteRead" 15 | ] 16 | }, 17 | "HTTPResponse.read_chunked": { 18 | "raises": [ 19 | "BodyNotHttplibCompatible", 20 | "ResponseNotChunked" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/connection.json: -------------------------------------------------------------------------------- 1 | { 2 | "create_connection": { 3 | "raises": [ 4 | "err" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/request.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewind_body": { 3 | "raises": [ 4 | "UnrewindableBodyError", 5 | "ValueError" 6 | ] 7 | }, 8 | "set_file_position": { 9 | "raises": [ 10 | "UnrewindableBodyError", 11 | "ValueError" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "assert_header_parsing": { 3 | "raises": [ 4 | "HeaderParsingError", 5 | "TypeError" 6 | ] 7 | }, 8 | "is_fp_closed": { 9 | "raises": [ 10 | "ValueError" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/retry.json: -------------------------------------------------------------------------------- 1 | { 2 | "Retry.increment": { 3 | "raises": [ 4 | "MaxRetryError" 5 | ] 6 | }, 7 | "Retry.parse_retry_after": { 8 | "raises": [ 9 | "InvalidHeader" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/ssl_.json: -------------------------------------------------------------------------------- 1 | { 2 | "_is_key_file_encrypted": { 3 | "has": [ 4 | "read" 5 | ] 6 | }, 7 | "assert_fingerprint": { 8 | "raises": [ 9 | "SSLError" 10 | ] 11 | }, 12 | "ssl_wrap_socket": { 13 | "has": [ 14 | "import" 15 | ], 16 | "raises": [ 17 | "RuntimeError", 18 | "SSLError", 19 | "TypeError", 20 | "message" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/timeout.json: -------------------------------------------------------------------------------- 1 | { 2 | "Timeout._validate_timeout": { 3 | "raises": [ 4 | "ValueError" 5 | ] 6 | }, 7 | "Timeout.get_connect_duration": { 8 | "raises": [ 9 | "TimeoutStateError" 10 | ] 11 | }, 12 | "Timeout.start_connect": { 13 | "raises": [ 14 | "TimeoutStateError" 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /deal/linter/stubs/urllib3/util/wait.json: -------------------------------------------------------------------------------- 1 | { 2 | "null_wait_for_socket": { 3 | "raises": [ 4 | "NoWayToWaitForSocketError" 5 | ] 6 | }, 7 | "poll_wait_for_socket": { 8 | "raises": [ 9 | "RuntimeError" 10 | ] 11 | }, 12 | "select_wait_for_socket": { 13 | "raises": [ 14 | "RuntimeError" 15 | ] 16 | }, 17 | "wait_for_read": { 18 | "has": [ 19 | "global" 20 | ], 21 | "raises": [ 22 | "NoWayToWaitForSocketError", 23 | "RuntimeError" 24 | ] 25 | }, 26 | "wait_for_socket": { 27 | "has": [ 28 | "global" 29 | ], 30 | "raises": [ 31 | "NoWayToWaitForSocketError", 32 | "RuntimeError" 33 | ] 34 | }, 35 | "wait_for_write": { 36 | "has": [ 37 | "global" 38 | ], 39 | "raises": [ 40 | "NoWayToWaitForSocketError", 41 | "RuntimeError" 42 | ] 43 | } 44 | } -------------------------------------------------------------------------------- /deal/py.typed: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/details/cli.md: -------------------------------------------------------------------------------- 1 | # CLI 2 | 3 | ## lint 4 | 5 | ```{eval-rst} 6 | .. autofunction:: deal._cli._lint.LintCommand 7 | ``` 8 | 9 | ## decorate 10 | 11 | ```{eval-rst} 12 | .. autofunction:: deal._cli._decorate.DecorateCommand 13 | ``` 14 | 15 | ## test 16 | 17 | ```{eval-rst} 18 | .. autofunction:: deal._cli._test.TestCommand 19 | ``` 20 | 21 | ## memtest 22 | 23 | ```{eval-rst} 24 | .. autofunction:: deal._cli._memtest.MemtestCommand 25 | ``` 26 | 27 | ## stub 28 | 29 | ```{eval-rst} 30 | .. autofunction:: deal._cli._stub.StubCommand 31 | ``` 32 | 33 | ## prove 34 | 35 | ```{eval-rst} 36 | .. autofunction:: deal._cli._prove.ProveCommand 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Deal 2 | 3 | ```{include} ../README.md 4 | ``` 5 | 6 | ```{eval-rst} 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | :caption: Getting started 11 | 12 | basic/intro 13 | basic/motivation 14 | basic/refs 15 | 16 | .. toctree:: 17 | :maxdepth: 1 18 | :caption: Writing contracts 19 | 20 | basic/values 21 | basic/exceptions 22 | basic/side-effects 23 | 24 | .. toctree:: 25 | :maxdepth: 1 26 | :caption: Checking contracts 27 | 28 | basic/runtime 29 | basic/tests 30 | basic/linter 31 | basic/verification 32 | basic/crosshair 33 | 34 | .. toctree:: 35 | :maxdepth: 1 36 | :caption: Dive deeper 37 | 38 | details/contracts 39 | details/module_load 40 | details/dispatch 41 | details/docs 42 | details/stubs 43 | details/tests 44 | details/recipes 45 | details/examples 46 | details/cli 47 | details/api 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | .[docs] 2 | -------------------------------------------------------------------------------- /examples/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/examples/__init__.py -------------------------------------------------------------------------------- /examples/choice.py: -------------------------------------------------------------------------------- 1 | import random 2 | from typing import List 3 | 4 | import deal 5 | 6 | 7 | # the list cannot be empty 8 | @deal.pre(lambda items: bool(items)) 9 | # result is an element withit the given list 10 | @deal.ensure(lambda items, result: result in items) 11 | @deal.has('random') 12 | def choice(items: List[str]) -> str: 13 | """Get a random element from the given list. 14 | """ 15 | return random.choice(items) 16 | 17 | 18 | test_choice = deal.cases(choice) 19 | -------------------------------------------------------------------------------- /examples/concat.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | @deal.ensure(lambda _: _.result.startswith(_.left)) 5 | @deal.ensure(lambda _: _.result.endswith(_.right)) 6 | @deal.ensure(lambda _: len(_.result) == len(_.left) + len(_.right)) 7 | @deal.has() 8 | def concat(left: str, right: str) -> str: 9 | """Concatenate 2 given strings. 10 | 11 | https://deal.readthedocs.io/basic/motivation.html 12 | """ 13 | return left + right 14 | 15 | 16 | test_concat = deal.cases(concat) 17 | -------------------------------------------------------------------------------- /examples/count.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | import deal 4 | 5 | 6 | # In short signature, `_` is a `dict` with access by attributes. 7 | # Hence it has all dict attributes. So, if argument we need conflicts 8 | # with a dict attribute, use getitem instead of getattr. 9 | # In the example below, we use `_['items']` instead of `_.items`. 10 | 11 | @deal.post(lambda result: result >= 0) 12 | # if count is not zero, `item` appears in `items` at least once. 13 | @deal.ensure(lambda _: _.result == 0 or _['item'] in _['items']) 14 | # if count is zero, `item` is not in `items` 15 | @deal.ensure(lambda _: _.result != 0 or _['item'] not in _['items']) 16 | @deal.has() 17 | def count(items: List[str], item: str) -> int: 18 | """How many times `item` appears in `items` 19 | """ 20 | return items.count(item) 21 | 22 | 23 | test_count = deal.cases(count) 24 | -------------------------------------------------------------------------------- /examples/div.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | @deal.raises(ZeroDivisionError) 5 | @deal.reason(ZeroDivisionError, lambda _: _.right == 0) 6 | @deal.has() 7 | def div1(left: float, right: float) -> float: 8 | """ 9 | This implementation allows zero to be passed 10 | but raises ZeroDivisionError in that case. 11 | """ 12 | return left / right 13 | 14 | 15 | @deal.pre(lambda _: _.right != 0) 16 | @deal.has() 17 | def div2(left: float, right: float) -> float: 18 | """ 19 | This implementation doesn't allow zero to be passed in a function. 20 | If it is accidentally passed, PreConditionError will be raised 21 | and the funcrion won't be executed. 22 | """ 23 | return left / right 24 | 25 | 26 | test_div1 = deal.cases(div1) 27 | test_div2 = deal.cases(div2) 28 | -------------------------------------------------------------------------------- /examples/format.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import deal 4 | 5 | 6 | def contract(template: str, *args): 7 | rex = re.compile(r'\{\:([a-z])\}') 8 | types = {'s': str, 'd': float} 9 | matches = rex.findall(template) 10 | if len(matches) != len(args): 11 | return f'expected {len(matches)} argument(s) but {len(args)} found' 12 | for match, arg in zip(matches, args): 13 | t = types[match[0]] 14 | if not isinstance(arg, t): 15 | return f'expected {t.__name__}, {type(arg).__name__} given' 16 | return True 17 | 18 | 19 | @deal.pre(contract) 20 | def format(template: str, *args) -> str: 21 | return template.format(*args) 22 | 23 | 24 | @deal.has('io') 25 | def example(): 26 | # good 27 | print(format('{:s}', 'hello')) 28 | 29 | # bad 30 | print(format('{:s}')) # not enough args 31 | print(format('{:s}', 'a', 'b')) # too many args 32 | print(format('{:d}', 'a')) # bad type 33 | 34 | 35 | if __name__ == '__main__': 36 | print(format('{:s} {:s}', 'hello', 'world')) 37 | -------------------------------------------------------------------------------- /examples/fuzzing_atheris.py: -------------------------------------------------------------------------------- 1 | """ 2 | Get help for libFuzzer: 3 | python3 examples/fuzzing_atheris.py -help=1 4 | 5 | Run 1000 test cases: 6 | python3 examples/fuzzing_atheris.py -runs=1000 7 | """ 8 | import codecs 9 | import sys 10 | 11 | import atheris 12 | 13 | import deal 14 | 15 | 16 | def encode(text: str) -> str: 17 | return codecs.encode(text, encoding='rot13') 18 | 19 | 20 | @deal.ensure(lambda text, result: encode(result) == text) 21 | def decode(text: str) -> str: 22 | assert text != 'bad' 23 | return codecs.encode(text, encoding='rot13') 24 | 25 | 26 | def fuzz(): 27 | test = deal.cases(decode) 28 | atheris.Setup(sys.argv, test) 29 | atheris.Fuzz() 30 | 31 | 32 | if __name__ == '__main__': 33 | fuzz() 34 | -------------------------------------------------------------------------------- /examples/fuzzing_pythonfuzz.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | 3 | from pythonfuzz.main import PythonFuzz 4 | 5 | import deal 6 | 7 | 8 | def encode(text: str) -> str: 9 | return codecs.encode(text, encoding='rot13') 10 | 11 | 12 | @deal.ensure(lambda text, result: encode(result) == text) 13 | def decode(text: str) -> str: 14 | assert text != 'bad' 15 | return codecs.encode(text, encoding='rot13') 16 | 17 | 18 | def fuzz(): 19 | test = deal.cases(decode) 20 | PythonFuzz(test)() 21 | 22 | 23 | if __name__ == '__main__': 24 | fuzz() 25 | -------------------------------------------------------------------------------- /examples/index_of.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | import deal 4 | 5 | 6 | # if you have more than 2-3 contracts, 7 | # consider moving them from decorators into separate variable 8 | # like this: 9 | contract_for_index_of = deal.chain( 10 | # result is an index of items 11 | deal.post(lambda result: result >= 0), 12 | deal.ensure(lambda items, item, result: result < len(items)), 13 | # element at this position matches item 14 | deal.ensure( 15 | lambda items, item, result: items[result] == item, 16 | message='invalid match', 17 | ), 18 | # element at this position is the first match 19 | deal.ensure( 20 | lambda items, item, result: not any(el == item for el in items[:result]), 21 | message='not the first match', 22 | ), 23 | # LookupError will be raised if no elements found 24 | deal.raises(LookupError), 25 | deal.reason(LookupError, lambda items, item: item not in items), 26 | # no side-effects 27 | deal.has(), 28 | ) 29 | 30 | 31 | @contract_for_index_of 32 | def index_of(items: List[int], item: int) -> int: 33 | for index, el in enumerate(items): 34 | if el == item: 35 | return index 36 | raise LookupError 37 | 38 | 39 | test_index_of = deal.cases(index_of) 40 | -------------------------------------------------------------------------------- /examples/min.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | import deal 4 | 5 | 6 | @deal.pre(lambda items: len(items) > 0) 7 | @deal.has() 8 | def my_min(items: List[int]) -> int: 9 | return min(items) 10 | 11 | 12 | @deal.has('stdout') 13 | def example(): 14 | # good 15 | print(my_min([3, 1, 4])) 16 | # bad 17 | print(my_min([])) 18 | 19 | 20 | test_min = deal.cases(my_min) 21 | -------------------------------------------------------------------------------- /examples/sphinx.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | @deal.reason(ZeroDivisionError, lambda a, b: b == 0) 5 | @deal.reason(ValueError, lambda a, b: a == b, message='a is equal to b') 6 | @deal.raises(ValueError, IndexError, ZeroDivisionError) 7 | @deal.pre(lambda a, b: b != 0) 8 | @deal.pre(lambda a, b: b != 0, message='b is not zero') 9 | @deal.ensure(lambda a, b, result: b != result) 10 | @deal.post(lambda res: res != .13) 11 | @deal.has('database', 'network') 12 | @deal.example(lambda: example(6, 2) == 3) 13 | def example(a: int, b: int) -> float: 14 | """Example function. 15 | 16 | :return: The description for return value. 17 | """ 18 | return a / b 19 | -------------------------------------------------------------------------------- /examples/using_hypothesis.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | import hypothesis 4 | 5 | import deal 6 | 7 | 8 | @deal.pre(lambda items: len(items) > 0) 9 | @deal.has() 10 | def my_min(items: List[int]) -> int: 11 | return min(items) 12 | 13 | 14 | @hypothesis.example([1, 2, 3]) 15 | @deal.cases( 16 | func=my_min, 17 | settings=hypothesis.settings( 18 | verbosity=hypothesis.Verbosity.normal, 19 | ), 20 | ) 21 | def test_min(case): 22 | case() 23 | 24 | 25 | if __name__ == '__main__': 26 | test_min() 27 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/logo.png -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 110 3 | ignore = 4 | exclude = 5 | .venvs/ 6 | types/ 7 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_chain.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import deal 4 | 5 | 6 | def test_chained_contract_decorator(): 7 | 8 | @deal.chain( 9 | deal.pre(lambda x: x != 1), 10 | deal.pre(lambda x: x != 2), 11 | ) 12 | def func(x): 13 | return x * 4 14 | 15 | func(3) 16 | func(0) 17 | with pytest.raises(deal.PreContractError): 18 | func(1) 19 | with pytest.raises(deal.PreContractError): 20 | func(2) 21 | -------------------------------------------------------------------------------- /tests/test_cli/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/tests/test_cli/__init__.py -------------------------------------------------------------------------------- /tests/test_cli/test_common.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pytest 4 | 5 | from deal._cli._common import get_paths 6 | 7 | 8 | def test_get_paths(tmp_path: Path): 9 | (tmp_path / 'subdir').mkdir() 10 | (tmp_path / 'subdir' / '__pycache__').mkdir() 11 | (tmp_path / '.hidden').mkdir() 12 | 13 | (tmp_path / 'setup.py').touch() 14 | (tmp_path / 'subdir' / 'ex.py').touch() 15 | (tmp_path / '.hidden' / 'ex.py').touch() 16 | (tmp_path / 'subdir' / '__pycache__' / 'ex.py').touch() 17 | (tmp_path / 'setup.pl').touch() 18 | actual = {p.relative_to(tmp_path) for p in get_paths(tmp_path)} 19 | assert actual == {Path('setup.py'), Path('subdir/ex.py')} 20 | 21 | with pytest.raises(FileNotFoundError): 22 | list(get_paths(tmp_path / 'not_exists')) 23 | -------------------------------------------------------------------------------- /tests/test_cli/test_main.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | 3 | from deal._cli import main 4 | from deal._cli._base import Command 5 | 6 | 7 | class FakeCommand(Command): 8 | @staticmethod 9 | def init_parser(parser: ArgumentParser) -> None: 10 | parser.add_argument('args', nargs='*') 11 | 12 | def __call__(self, args) -> int: 13 | assert args.args == ['a1', 'a2'] 14 | return 13 15 | 16 | 17 | def test_calls_command(): 18 | result = main(argv=['fake', 'a1', 'a2'], commands=dict(fake=FakeCommand)) 19 | assert result == 13 20 | 21 | 22 | def test_unknown_command(capsys): 23 | result = main(argv=['unknown', 'a1', 'a2'], commands=dict(fake=FakeCommand)) 24 | assert result == 2 25 | captured = capsys.readouterr() 26 | exp1 = "invalid choice: 'unknown' (choose from fake)" 27 | exp2 = "invalid choice: 'unknown' (choose from 'fake')" 28 | assert exp1 in captured.err or exp2 in captured.err 29 | 30 | 31 | def test_no_command_specified(capsys): 32 | result = main(argv=[], commands=dict(fake=FakeCommand)) 33 | assert result == 2 34 | captured = capsys.readouterr() 35 | assert 'positional arguments:' in captured.out 36 | assert 'fake' in captured.out 37 | -------------------------------------------------------------------------------- /tests/test_cli/test_stub.py: -------------------------------------------------------------------------------- 1 | import json 2 | from pathlib import Path 3 | 4 | import pytest 5 | 6 | from deal._cli import main 7 | 8 | 9 | try: 10 | import astroid 11 | except ImportError: 12 | astroid = None 13 | 14 | 15 | TEXT = """ 16 | import deal 17 | 18 | def f(x): 19 | raise PatheticError 20 | """ 21 | 22 | 23 | @pytest.mark.skipif(astroid is None, reason='astroid is not installed') 24 | def test_stub_command(tmp_path: Path): 25 | path = (tmp_path / 'example.py') 26 | path.write_text(TEXT) 27 | result = main(['stub', '--iterations', '1', str(path)]) 28 | assert result == 0 29 | content = (tmp_path / 'example.json').read_text() 30 | assert json.loads(content) == {'f': {'raises': ['PatheticError']}} 31 | -------------------------------------------------------------------------------- /tests/test_linter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/tests/test_linter/__init__.py -------------------------------------------------------------------------------- /tests/test_linter/helpers.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import ast 4 | from textwrap import dedent 5 | from typing import TypeVar 6 | 7 | from deal.linter._func import Func 8 | 9 | 10 | T = TypeVar('T') 11 | 12 | 13 | def first(funcs: list[T]) -> T: 14 | assert len(funcs) == 1 15 | return funcs[0] 16 | 17 | 18 | def funcs_from_ast(text: str) -> list[Func]: 19 | text = dedent(text).strip() 20 | tree = ast.parse(text) 21 | print(ast.dump(tree)) 22 | return Func.from_ast(tree) 23 | 24 | 25 | def funcs_from_astroid(text: str) -> list[Func]: 26 | import astroid 27 | 28 | text = dedent(text).strip() 29 | tree = astroid.parse(text) 30 | print(tree.repr_tree()) 31 | return Func.from_astroid(tree) 32 | -------------------------------------------------------------------------------- /tests/test_linter/test_error.py: -------------------------------------------------------------------------------- 1 | from deal.linter._error import Error 2 | 3 | 4 | def test_error(): 5 | err = Error(row=1, col=2, code=3, text='check') 6 | assert tuple(err) == (1, 2, 'DEL003 check') 7 | assert str(err) == 'DEL003 check' 8 | assert repr(err).startswith('Error(') 9 | -------------------------------------------------------------------------------- /tests/test_linter/test_extractors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/tests/test_linter/test_extractors/__init__.py -------------------------------------------------------------------------------- /tests/test_linter/test_extractors/test_asserts.py: -------------------------------------------------------------------------------- 1 | import ast 2 | 3 | import pytest 4 | 5 | from deal.linter._extractors import get_asserts 6 | 7 | 8 | try: 9 | import astroid 10 | except ImportError: 11 | astroid = None 12 | 13 | 14 | @pytest.mark.parametrize('text, expected', [ 15 | ('assert 1', ()), 16 | ('assert True', ()), 17 | ('assert "abc"', ()), 18 | ('assert "abc", "do not panic"', ()), 19 | 20 | ('assert 0', (0, )), 21 | ('assert False', (False, )), 22 | ('assert ""', ('', )), 23 | ('assert []', ([], )), 24 | 25 | ('assert 3 - 2', ()), 26 | # ('assert 2 - 2', (0, )), 27 | ('assert a', ()), # ignore uninferrable names 28 | ('a = object()\nassert a', ()), 29 | ]) 30 | def test_get_asserts_simple(text, expected): 31 | if astroid is not None: 32 | tree = astroid.parse(text) 33 | print(tree.repr_tree()) 34 | returns = tuple(r.value for r in get_asserts(body=tree.body)) 35 | assert returns == expected 36 | 37 | ast_tree = ast.parse(text) 38 | print(ast.dump(ast_tree)) 39 | returns = tuple(r.value for r in get_asserts(body=ast_tree.body)) 40 | assert returns == expected 41 | -------------------------------------------------------------------------------- /tests/test_linter/test_extractors/test_definitions.py: -------------------------------------------------------------------------------- 1 | import ast 2 | 3 | import pytest 4 | 5 | from deal.linter._extractors import get_definitions 6 | 7 | 8 | try: 9 | import astroid 10 | except ImportError: 11 | astroid = None 12 | 13 | 14 | @pytest.mark.parametrize('source, names', [ 15 | ('import re', {'re'}), 16 | ('import typing, types', {'typing', 'types'}), 17 | ('import typing as types', {'types'}), 18 | ('from . import hi', set()), 19 | ('from .something import hi', set()), 20 | 21 | ('from typing import List', {'List'}), 22 | ('from typing import List, Dict', {'List', 'Dict'}), 23 | 24 | ('ab = 2', {'ab'}), 25 | ('ab = cd = 23', {'ab', 'cd'}), 26 | ('ab.cd = 2', set()), 27 | ]) 28 | def test_extract_defs(source: str, names) -> None: 29 | ast_tree = ast.parse(source) 30 | print(ast.dump(ast_tree)) 31 | ast_defs = get_definitions(ast_tree) 32 | assert set(ast_defs) == names 33 | 34 | if astroid is not None: 35 | tree = astroid.parse(source) 36 | print(tree.repr_tree()) 37 | defs = get_definitions(tree) 38 | assert set(defs) == names 39 | -------------------------------------------------------------------------------- /tests/test_linter/test_extractors/test_imports.py: -------------------------------------------------------------------------------- 1 | import ast 2 | 3 | import pytest 4 | 5 | from deal.linter._extractors import get_imports 6 | 7 | 8 | try: 9 | import astroid 10 | except ImportError: 11 | astroid = None 12 | 13 | 14 | @pytest.mark.parametrize('text, expected', [ 15 | ('from deal import pre', ('deal', )), 16 | ]) 17 | def test_get_imports_simple(text, expected): 18 | if astroid is not None: 19 | tree = astroid.parse(text) 20 | print(tree.repr_tree()) 21 | returns = tuple(r.value for r in get_imports(body=tree.body)) 22 | assert returns == expected 23 | 24 | ast_tree = ast.parse(text) 25 | print(ast.dump(ast_tree)) 26 | returns = tuple(r.value for r in get_imports(body=ast_tree.body)) 27 | assert returns == expected 28 | -------------------------------------------------------------------------------- /tests/test_linter/test_extractors/test_result.py: -------------------------------------------------------------------------------- 1 | import ast 2 | 3 | import pytest 4 | 5 | from deal.linter._extractors import uses_result 6 | 7 | 8 | try: 9 | import astroid 10 | except ImportError: 11 | astroid = None 12 | 13 | 14 | @pytest.mark.parametrize('given, expected', [ 15 | # positive 16 | ('lambda a, result: 0', True), 17 | ('lambda a, result: 0', True), 18 | ('lambda a, *, result: 0', True), 19 | ('lambda *a, result: 0', True), 20 | ('lambda *a, result=None: 0', True), 21 | ('lambda _: _.result', True), 22 | ('lambda _: len(_.result) == _.length', True), 23 | 24 | # non-lambdas are allowed 25 | ('unknown', True), 26 | ('sum', True), 27 | 28 | # negative 29 | ('lambda _: 0', False), 30 | ('lambda _: _', False), 31 | ('lambda _: _.other', False), 32 | ('lambda a: 0', False), 33 | ('lambda a, res: 0', False), 34 | ('lambda a, *, res: 0', False), 35 | ]) 36 | def test_uses_result(given: str, expected: bool): 37 | if astroid is not None: 38 | tree = astroid.parse(given) 39 | print(tree.repr_tree()) 40 | validator = tree.body[0].value 41 | assert uses_result(validator) is expected 42 | 43 | ast_tree = ast.parse(given) 44 | print(ast.dump(ast_tree)) 45 | validator = ast_tree.body[0].value # type: ignore[attr-defined] 46 | assert uses_result(validator) is expected 47 | -------------------------------------------------------------------------------- /tests/test_linter/test_main.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | 4 | 5 | def test_cli_calling(): 6 | result = subprocess.run([sys.executable, '-m', 'deal.linter', __file__]) 7 | assert result.returncode == 0 8 | -------------------------------------------------------------------------------- /tests/test_main.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | 4 | 5 | def test_cli_calling(): 6 | result = subprocess.run([sys.executable, '-m', 'deal', 'lint', __file__]) 7 | assert result.returncode == 0 8 | -------------------------------------------------------------------------------- /tests/test_mem_test.py: -------------------------------------------------------------------------------- 1 | from deal._mem_test import MemoryTracker 2 | 3 | 4 | def test_mem_dump_no_diff(): 5 | def f() -> int: 6 | return 123 7 | 8 | tracker = MemoryTracker() 9 | with tracker: 10 | f() 11 | assert not tracker.diff 12 | 13 | 14 | def test_mem_dump_ignore_locals(): 15 | def f(): 16 | a = 456 17 | b = a 18 | return b 19 | 20 | tracker = MemoryTracker() 21 | with tracker: 22 | f() 23 | assert not tracker.diff 24 | 25 | 26 | def test_mem_dump_side_effect(): 27 | a = [] 28 | 29 | def f() -> int: 30 | a.append({12}) 31 | return 123 32 | 33 | tracker = MemoryTracker() 34 | with tracker: 35 | f() 36 | assert dict(tracker.diff) == {'set': 1} 37 | -------------------------------------------------------------------------------- /tests/test_runtime/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/life4/deal/2e9d6e0f409e96bb8745b21d5c8dc2573f10fe2e/tests/test_runtime/__init__.py -------------------------------------------------------------------------------- /tests/test_runtime/helpers.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | 4 | def run_sync(coroutine): 5 | return asyncio.run(coroutine) 6 | -------------------------------------------------------------------------------- /tests/test_runtime/test_example.py: -------------------------------------------------------------------------------- 1 | from asyncio import iscoroutinefunction 2 | from inspect import isgeneratorfunction 3 | 4 | import deal 5 | 6 | from .helpers import run_sync 7 | 8 | 9 | def test_example_is_not_triggered_in_runtime(): 10 | @deal.example(lambda: False) 11 | @deal.example(lambda: 1 / 0 == 0) 12 | def f1() -> bool: 13 | return True 14 | 15 | assert f1() is True 16 | 17 | 18 | def test_example_does_not_break_iterator(): 19 | @deal.example(lambda: False) 20 | @deal.example(lambda: 1 / 0 == 0) 21 | def f1(): 22 | yield True 23 | 24 | assert isgeneratorfunction(f1) is True 25 | assert next(f1()) is True 26 | assert list(f1()) == [True] 27 | 28 | 29 | def test_example_does_not_break_async(): 30 | @deal.example(lambda: False) 31 | @deal.example(lambda: 1 / 0 == 0) 32 | async def f1() -> bool: 33 | return True 34 | 35 | assert iscoroutinefunction(f1) is True 36 | assert run_sync(f1()) is True 37 | -------------------------------------------------------------------------------- /tests/test_runtime/test_post.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import deal 4 | 5 | from .helpers import run_sync 6 | 7 | 8 | def test_return_value_fulfils_contract(): 9 | func = deal.post(lambda x: x > 0)(lambda x: -x) 10 | assert func(-4) == 4 11 | 12 | with pytest.raises(deal.PostContractError): 13 | func(4) 14 | 15 | 16 | def test_decorating_async_function(): 17 | @deal.post(lambda x: x > 0) 18 | async def func(x): 19 | return -x 20 | 21 | assert run_sync(func(-2)) == 2 22 | with pytest.raises(deal.PostContractError): 23 | run_sync(func(2)) 24 | 25 | 26 | def test_decorating_generator(): 27 | @deal.post(lambda x: x <= 8) 28 | def double(x): 29 | yield x 30 | yield x * 2 31 | yield x * 4 32 | 33 | assert list(double(2)) == [2, 4, 8] 34 | with pytest.raises(deal.PostContractError): 35 | list(double(4)) 36 | -------------------------------------------------------------------------------- /tests/test_runtime/test_pure.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import urllib3 3 | 4 | import deal 5 | 6 | 7 | def test_pure_silent(): 8 | @deal.pure 9 | def func(msg): 10 | if msg: 11 | print(msg) 12 | 13 | func(None) 14 | with pytest.raises(deal.SilentContractError): 15 | func('bad') 16 | 17 | 18 | def test_pure_safe(): 19 | func = deal.pure(lambda x: 1 / x) 20 | func(2) 21 | with pytest.raises(deal.RaisesContractError): 22 | func(0) 23 | 24 | 25 | def test_pure_offline(): 26 | @deal.pure 27 | def func(do): 28 | if do: 29 | http = urllib3.PoolManager() 30 | http.request('GET', 'http://httpbin.org/robots.txt') 31 | 32 | func(False) 33 | with pytest.raises(deal.OfflineContractError): 34 | func(True) 35 | -------------------------------------------------------------------------------- /tests/test_runtime/test_safe.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import deal 4 | 5 | from .helpers import run_sync 6 | 7 | 8 | def test_safe(): 9 | func = deal.safe(lambda x: 1 / x) 10 | func(2) 11 | with pytest.raises(deal.RaisesContractError): 12 | func(0) 13 | 14 | 15 | def test_decorating_async_function(): 16 | @deal.safe 17 | async def func(x): 18 | return 10 / x 19 | 20 | assert run_sync(func(2)) == 5 21 | with pytest.raises(deal.RaisesContractError): 22 | run_sync(func(0)) 23 | -------------------------------------------------------------------------------- /tests/test_runtime/test_validators.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from deal._runtime._validators import _args_to_vars, _get_signature 4 | 5 | 6 | @pytest.mark.parametrize('args, kwargs, f, expected', [ 7 | # args 8 | ( 9 | [1], dict(), 10 | lambda x: 0, 11 | dict(x=1), 12 | ), 13 | # kwargs 14 | ( 15 | [], dict(x=2), 16 | lambda x: 0, 17 | dict(x=2), 18 | ), 19 | # args and kwargs 20 | ( 21 | [1, 2], dict(c=3, d=4), 22 | lambda a, b, c, d: 0, 23 | dict(a=1, b=2, c=3, d=4), 24 | ), 25 | # *args 26 | ( 27 | [1, 2], dict(), 28 | lambda *other: 0, 29 | dict(other=(1, 2)), 30 | ), 31 | # **kwargs 32 | ( 33 | [], dict(a=1, b=2), 34 | lambda **other: 0, 35 | dict(a=1, b=2, other=dict(a=1, b=2)), 36 | ), 37 | ]) 38 | def test_args_to_vars(args, kwargs, f, expected): 39 | sig = _get_signature(f) 40 | actual = _args_to_vars(args=args, kwargs=kwargs, signature=sig) 41 | assert actual == expected 42 | -------------------------------------------------------------------------------- /types/types_dispatch.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.dispatch 6 | def double(a: int) -> int: 7 | raise NotImplementedError 8 | 9 | @double.register 10 | @deal.pre(lambda a: a == 2) 11 | def _1(a: int) -> int: 12 | return 4 13 | 14 | # Preserve function type 15 | # R: deal._runtime._dispatch.Dispatch[def (a: builtins.int) -> builtins.int] 16 | reveal_type(double) 17 | 18 | res = double(2) 19 | reveal_type(res) # R: builtins.int 20 | 21 | # Enforce contrvariance 22 | # E: Argument 1 to "register" of "Dispatch" has incompatible type "Callable[[bool], int]"; expected "Callable[[int], int]" 23 | @double.register 24 | def _2(a: bool) -> int: 25 | return 4 26 | 27 | # Enforce covariance 28 | # E: Argument 1 to "register" of "Dispatch" has incompatible type "Callable[[int], float]"; expected "Callable[[int], int]" 29 | @double.register 30 | def _3(a: int) -> float: 31 | return True 32 | -------------------------------------------------------------------------------- /types/types_ensure.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.ensure(lambda a, b, result: a > b) 6 | def f(a: int, b: int) -> str: 7 | return str(a + b) 8 | reveal_type(f) # R: def (a: builtins.int, b: builtins.int) -> builtins.str 9 | 10 | 11 | def infer_validator_type() -> None: 12 | # E: "int" has no attribute "hi" 13 | @deal.ensure(lambda a, b, result: a.hi) 14 | # E: "str" has no attribute "hello" 15 | @deal.ensure(lambda a, b, result: result.hello) 16 | def f(a: int, b: int) -> str: 17 | return str(a + b) 18 | -------------------------------------------------------------------------------- /types/types_has.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.has('db', 'network') 6 | def f(a: int, b: int) -> str: 7 | return str(a + b) 8 | reveal_type(f) # R: def (a: builtins.int, b: builtins.int) -> builtins.str 9 | -------------------------------------------------------------------------------- /types/types_inherit.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def inherit_method() -> None: 5 | class A: 6 | def f(self, x: int): 7 | raise NotImplementedError 8 | 9 | class B(A): 10 | @deal.inherit 11 | def f(self, x: int) -> float: 12 | raise NotImplementedError 13 | 14 | reveal_type(B().f) # R: def (x: builtins.int) -> builtins.float 15 | 16 | 17 | def inherit_class() -> None: 18 | class A: 19 | def f(self, x: int): 20 | raise NotImplementedError 21 | 22 | @deal.inherit 23 | class B(A): 24 | def f(self, x: int) -> float: 25 | raise NotImplementedError 26 | 27 | reveal_type(B().f) # R: def (x: builtins.int) -> builtins.float 28 | -------------------------------------------------------------------------------- /types/types_inv.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.inv(lambda obj: obj.likes >= 0) 6 | class Video: 7 | likes: int 8 | 9 | v = Video() 10 | reveal_type(v) # R: types_inv.Video@6 11 | 12 | 13 | def infer_validator_type() -> None: 14 | # E: "Video" has no attribute "hello" 15 | @deal.inv(lambda obj: obj.hello) 16 | class Video: 17 | likes: int 18 | -------------------------------------------------------------------------------- /types/types_post.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.post(lambda r: r > 0) 6 | def f() -> int: 7 | return 4 8 | reveal_type(f) # R: def () -> builtins.int 9 | 10 | 11 | def infer_validator_type() -> None: 12 | # E: "int" has no attribute "hi" 13 | @deal.post(lambda r: r.hi) 14 | def f() -> int: 15 | return 4 16 | 17 | 18 | def report_bad_arity() -> None: 19 | # TODO: Fix "Cannot infer type of lambda" 20 | 21 | # E: Argument 1 to "post" has incompatible type "Callable[[], bool]"; expected "Callable[[int], Union[bool, str]]" 22 | @deal.post(lambda: True) # E: Cannot infer type of lambda 23 | def f() -> int: 24 | return 4 25 | 26 | 27 | def detect_methods() -> None: 28 | class A: 29 | # E: "int" has no attribute "hi" 30 | @deal.post(lambda r: r.hi) 31 | def f(self) -> int: 32 | return 4 33 | 34 | 35 | def do_not_fail_on_vaa_simple() -> None: 36 | @deal.post(lambda _: _.result == 4) 37 | def f(self) -> int: 38 | return 4 39 | 40 | 41 | def report_bad_return_type() -> None: 42 | # E: Argument 1 to "post" has incompatible type "Callable[[int], int]"; expected "Callable[[int], Union[bool, str]]" 43 | @deal.post(lambda x: x) # E: Incompatible return value type (got "int", expected "Union[bool, str]") 44 | def f(x) -> int: 45 | return 4 46 | -------------------------------------------------------------------------------- /types/types_pre.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.pre(lambda a, b: a > b) 6 | def f(a: int, b: int) -> str: 7 | return str(a + b) 8 | reveal_type(f) # R: def (a: builtins.int, b: builtins.int) -> builtins.str 9 | 10 | 11 | def infer_validator_type() -> None: 12 | # E: "int" has no attribute "hi" 13 | @deal.pre(lambda a, b: a.hi) 14 | def f(a: int, b: int) -> bool: 15 | return a > b 16 | -------------------------------------------------------------------------------- /types/types_reason.py: -------------------------------------------------------------------------------- 1 | import deal 2 | 3 | 4 | def preserve_function_annotation() -> None: 5 | @deal.reason(ZeroDivisionError, lambda a, b: a > b) 6 | def f(a: int, b: int) -> str: 7 | return str(a + b) 8 | reveal_type(f) # R: def (a: builtins.int, b: builtins.int) -> builtins.str 9 | 10 | 11 | def infer_validator_type() -> None: 12 | # E: "int" has no attribute "hi" 13 | @deal.reason(ZeroDivisionError, lambda a, b: a.hi) 14 | def f(a: int, b: int) -> bool: 15 | return a > b 16 | --------------------------------------------------------------------------------