"""
This type stub file was generated by pyright.
"""

import tokenize
from __future__ import annotations
from importlib import import_module
from os import path
from typing import Any, TYPE_CHECKING
from sphinx.errors import PycodeError
from sphinx.pycode.parser import Parser
from inspect import Signature

"""Utilities parsing and analyzing Python code."""
if TYPE_CHECKING:
    ...
class ModuleAnalyzer:
    annotations: dict[tuple[str, str], str]
    attr_docs: dict[tuple[str, str], list[str]]
    finals: list[str]
    overloads: dict[str, list[Signature]]
    tagorder: dict[str, int]
    tags: dict[str, tuple[str, int, int]]
    cache: dict[tuple[str, str], Any] = ...
    @staticmethod
    def get_module_source(modname: str) -> tuple[str | None, str | None]:
        """Try to find the source code for a module.

        Returns ('filename', 'source'). One of it can be None if
        no filename or source found
        """
        ...
    
    @classmethod
    def for_string(cls, string: str, modname: str, srcname: str = ...) -> ModuleAnalyzer:
        ...
    
    @classmethod
    def for_file(cls, filename: str, modname: str) -> ModuleAnalyzer:
        ...
    
    @classmethod
    def for_module(cls, modname: str) -> ModuleAnalyzer:
        ...
    
    def __init__(self, source: str, modname: str, srcname: str) -> None:
        ...
    
    def analyze(self) -> None:
        """Analyze the source code."""
        ...
    
    def find_attr_docs(self) -> dict[tuple[str, str], list[str]]:
        """Find class and module-level attributes and their documentation."""
        ...
    
    def find_tags(self) -> dict[str, tuple[str, int, int]]:
        """Find class, function and method definitions and their location."""
        ...
    


