def from_list(f: Callable[[Any], T], x: Any) -> list[T]:
    """
    Assert `x` is a list and call `f` on elements of `x`.

    Can be used for type checking each element of `x`.
    """
    assert isinstance(x, list)
    return list(map(f, x))

    Assert `x` is a list and call `f` on elements of `x`.

    Can be used for type checking each element of `x`.
    
preprocess/src/data_types/utils.py