def update_samples(
        self,
        update_fcn,
        skip_failures=True,
        parallelize_method=None,
        num_workers=None,
        batch_method=None,
        batch_size=None,
        progress=None,
    ):
        """Applies the given function to each sample in the collection and
        saves the resulting sample edits.

        By default, a multiprocessing pool is used to parallelize the work,
        unless this method is called in a daemon process (subprocess), in which
        case no workers are used.

        This function effectively performs the following map operation with the
        outer loop in parallel::

            for batch_view in fou.iter_slices(sample_collection, batch_size):
                for sample in batch_view.iter_samples(autosave=True):
                    map_fcn(sample)

        Example::

            import fiftyone as fo
            import fiftyone.zoo as foz

            dataset = foz.load_zoo_dataset("cifar10", split="train")
            view = dataset.select_fields("ground_truth")

            def update_fcn(sample):
                sample.ground_truth.label = sample.ground_truth.label.upper()

            view.update_samples(update_fcn)

            print(dataset.count_values("ground_truth.label"))

        Args:
            update_fcn: a function to apply to each sample in the collection
            skip_failures (True): whether to gracefully continue without
                raising an error if the update function raises an exception for
                a sample
            parallelize_method (None): the parallelization method to use.
                Supported values are ``{"process", "thread"}``. The default is
                ``fiftyone.config.default_parallelization_method``
            num_workers (None): the number of workers to use. When using
                process parallelism, this defaults to
                ``fiftyone.config.default_process_pool_workers`` if the value
                is set, else
                :meth:`fiftyone.core.utils.recommend_process_pool_workers`
                workers are used. If this value is <= 1, all work is done in
                the main process
            batch_method (None): whether to use IDs (``"id"``) or slices
                (``"slice"``) to assign samples to workers
            batch_size (None): an optional number of samples to distribute to
                each worker at a time. By default, samples are evenly
                distributed to workers with one batch per worker
            progress (None): whether to render a progress bar (True/False), use
                the default value ``fiftyone.config.show_progress_bars``
                (None), or a progress callback function to invoke instead, or
                "workers" to render per-worker progress bars
        """
        mapper = focm.MapperFactory.create(
            parallelize_method, num_workers, batch_method, batch_size
        )

        for _ in mapper.map_samples(
            self,
            update_fcn,
            progress=progress,
            save=True,
            skip_failures=skip_failures,
        ):
            ...
Applies the given function to each sample in the collection and
        saves the resulting sample edits.

        By default, a multiprocessing pool is used to parallelize the work,
        unless this method is called in a daemon process (subprocess), in which
        case no workers are used.

        This function effectively performs the following map operation with the
        outer loop in parallel::

            for batch_view in fou.iter_slices(sample_collection, batch_size):
                for sample in batch_view.iter_samples(autosave=True):
                    map_fcn(sample)

        Example::

            import fiftyone as fo
            import fiftyone.zoo as foz

            dataset = foz.load_zoo_dataset("cifar10", split="train")
            view = dataset.select_fields("ground_truth")

            def update_fcn(sample):
                sample.ground_truth.label = sample.ground_truth.label.upper()

            view.update_samples(update_fcn)

            print(dataset.count_values("ground_truth.label"))

        Args:
            update_fcn: a function to apply to each sample in the collection
            skip_failures (True): whether to gracefully continue without
                raising an error if the update function raises an exception for
                a sample
            parallelize_method (None): the parallelization method to use.
                Supported values are ``{"process", "thread"}``. The default is
                ``fiftyone.config.default_parallelization_method``
            num_workers (None): the number of workers to use. When using
                process parallelism, this defaults to
                ``fiftyone.config.default_process_pool_workers`` if the value
                is set, else
                :meth:`fiftyone.core.utils.recommend_process_pool_workers`
                workers are used. If this value is <= 1, all work is done in
                the main process
            batch_method (None): whether to use IDs (``"id"``) or slices
                (``"slice"``) to assign samples to workers
            batch_size (None): an optional number of samples to distribute to
                each worker at a time. By default, samples are evenly
                distributed to workers with one batch per worker
            progress (None): whether to render a progress bar (True/False), use
                the default value ``fiftyone.config.show_progress_bars``
                (None), or a progress callback function to invoke instead, or
                "workers" to render per-worker progress bars
        
fiftyone/core/collections.py