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

from typing import TypeVar
from streamlit.errors import Error

"""A bunch of useful utilities for the watcher.

These are functions that only make sense within the watcher. In particular,
functions that use streamlit.config can go here to avoid a dependency cycle.
"""
_MAX_RETRIES = ...
_RETRY_WAIT_SECS = ...
def calc_md5_with_blocking_retries(path: str, *, glob_pattern: str | None = ..., allow_nonexistent: bool = ...) -> str:
    """Calculate the MD5 checksum of a given path.

    For a file, this means calculating the md5 of the file's contents. For a
    directory, we concatenate the directory's path with the names of all the
    files in it and calculate the md5 of that.

    IMPORTANT: This method calls time.sleep(), which blocks execution. So you
    should only use this outside the main thread.
    """
    ...

def path_modification_time(path: str, allow_nonexistent: bool = ...) -> float:
    """Return the modification time of a path (file or directory).

    If allow_nonexistent is True and the path does not exist, we return 0.0 to
    guarantee that any file/dir later created at the path has a later
    modification time than the last time returned by this function for that
    path.

    If allow_nonexistent is False and no file/dir exists at the path, a
    FileNotFoundError is raised (by os.stat).

    For any path that does correspond to an existing file/dir, we return its
    modification time.
    """
    ...

T = TypeVar("T")
class MaxRetriesError(Error):
    ...


