def _map_samples_one_worker(
        self,
        sample_collection: SampleCollection[T],
        iter_fcn: Callable[
            [SampleCollection[T]], Iterable[Tuple[bson.ObjectId, U]]
        ],
        map_fcn: Callable[[U], R],
        *,
        progress: Union[bool, Literal["workers"], None],
    ) -> Iterator[
        Tuple[bson.ObjectId, Union[Exception, None], Union[R, None]]
    ]:
        """Applies map function to each sample (in serial) and returns an
        iterator of the results.
        """

        pb = fou.ProgressBar(
            total=len(sample_collection),
            # One worker means show the progress bar if there is a valid value
            progress=progress in (True, "workers"),
        )

        for sample_id, sample in iter_fcn(sample_collection):
            try:
                yield sample_id, None, map_fcn(sample)
            except Exception as err:

                yield sample_id, err, None
            finally:
                pb.update()
Applies map function to each sample (in serial) and returns an
        iterator of the results.
        
fiftyone/core/map/mapper.py