from collections.abc import Iterable, Sequence
from typing import Any

from _typeshed import StrOrBytesPath, StrPath, SupportsWrite
from django.apps.config import AppConfig
from django.db.models.base import Model

def popen_wrapper(args: list[str], stdout_encoding: str = "utf-8") -> tuple[str, str, int]: ...
def handle_extensions(extensions: Iterable[str]) -> set[str]: ...
def find_command(
    cmd: str,
    path: str | Iterable[str] | None = None,
    pathext: str | Iterable[str] | None = None,
) -> str | None: ...
def get_random_secret_key() -> str: ...
def parse_apps_and_model_labels(labels: Iterable[str]) -> tuple[set[type[Model]], set[AppConfig]]: ...
def get_command_line_option(argv: Sequence[Any], option: Any) -> Any | None: ...
def normalize_path_patterns(patterns: Iterable[str]) -> list[str]: ...
def is_ignored_path(path: StrPath, ignore_patterns: Iterable[str]) -> bool: ...
def find_formatters() -> dict[str, str | None]: ...
def run_formatters(
    written_files: Iterable[StrOrBytesPath], black_path: str = ..., stderr: SupportsWrite[str] = ...
) -> None: ...
