from collections.abc import Iterable
from typing import Any, Tuple
from typing_extensions import Literal

_Unit = Literal["pt", "mm", "cm", "in"]

def substr(s, start, length: int = ...): ...
def enclose_in_parens(s): ...
def escape_parens(s): ...
def b(s): ...
def get_scale_factor(unit: _Unit | float) -> float: ...
def convert_unit(
    # to_convert has a recursive type
    to_convert: float | Iterable[float | Iterable[Any]],
    old_unit: str | float,
    new_unit: str | float,
) -> float | Tuple[float, ...]: ...
def dochecks() -> None: ...
