from typing import Any, Protocol, TypeVar from unittest import mock T = TypeVar("T") class MockDependency(Protocol): def __call__(self, interface: type[T]) -> mock.Mock: pass class BuildModel(Protocol): def __call__(self, model: type[T], **kwargs: Any) -> T: ... class BuildModelBatch(Protocol): def __call__(self, model: type[T], *, size: int, **kwargs: Any) -> list[T]: ... class CreateModel(Protocol): async def __call__(self, model: type[T], **kwargs: Any) -> T: ... class CreateModelBatch(Protocol): async def __call__(self, model: type[T], *, size: int, **kwargs: Any) -> list[T]: ...