from typing import Any
from typing import Callable
from typing import Mapping
from typing import Sequence


def default_transform_call(batch: Any, transform: Callable) -> Any:
    """
    Default function to call transforms. Mapping and Sequences are
    unpacked during the transform call. Other types are passed
    as a positional argument.

    Args:
        batch: current batch which is passed to transforms
        transform: transform to perform

    Returns:
        Any: transformed batch

    """

    if isinstance(batch, Mapping):
        return transform(**batch)
    elif isinstance(batch, Sequence):
        return transform(*batch)
    else:
        return transform(batch)