def check_if_return_is_sample(
    sample_collection: SampleCollection[T], map_fcn: Callable[[T], R]
) -> bool:
    """
    Check if the map function returns a sample
    """

    first_sample = sample_collection.first()
    if first_sample is None:
        raise ValueError("Sample collection is empty")

    # make a copy outside of the db
    sample_copy = first_sample.copy()

    # run the map function on just the copy
    # if it returns a Sample object
    if isinstance(map_fcn(sample_copy), fos.Sample):
        return True

    return False

    Check if the map function returns a sample
    
fiftyone/core/map/mapper.py