from typing import Dict
from typing import Any
from typing import List


def _format_default_options(defaults: Dict[str, Any], indent: str = "") -> List[str]:
    """Format default options to docstring lines."""
    docstring_lines = [
        ".. dropdown:: Default values",
        indent + ":animate: fade-in-slide-down",
        "",
    ]

    if not defaults:
        docstring_lines.append(indent + "No default options are set.")
    else:
        docstring_lines.append(indent + "Following values are set by default.")
        docstring_lines.append("")
        docstring_lines.append(indent + ".. parsed-literal::")
        docstring_lines.append("")
        for par, value in defaults.items():
            if callable(value):
                if value.__class__.__name__ == "function":
                    # callback function
                    value_repr = f"Callable {value.__name__}"
                else:
                    # class instance with call method
                    value_repr = repr(value)
            else:
                value_repr = repr(value)
            docstring_lines.append(indent * 2 + f"{par:<25} := {value_repr}")

    return docstring_lines