def save_context(self, batch_size=None, batching_strategy=None):
        """Returns a context that can be used to save samples from this
        collection according to a configurable batching strategy.

        Examples::

            import random as r
            import string as s

            import fiftyone as fo
            import fiftyone.zoo as foz

            dataset = foz.load_zoo_dataset("cifar10", split="test")

            def make_label():
                return "".join(r.choice(s.ascii_letters) for i in range(10))

            # No save context
            for sample in dataset.iter_samples(progress=True):
                sample.ground_truth.label = make_label()
                sample.save()

            # Save using default batching strategy
            with dataset.save_context() as context:
                for sample in dataset.iter_samples(progress=True):
                    sample.ground_truth.label = make_label()
                    context.save(sample)

            # Save in batches of 10
            with dataset.save_context(batch_size=10) as context:
                for sample in dataset.iter_samples(progress=True):
                    sample.ground_truth.label = make_label()
                    context.save(sample)

            # Save every 0.5 seconds
            with dataset.save_context(batch_size=0.5) as context:
                for sample in dataset.iter_samples(progress=True):
                    sample.ground_truth.label = make_label()
                    context.save(sample)

        Args:
            batch_size (None): the batch size to use. If a ``batching_strategy``
                is provided, this parameter configures the strategy as
                described below. If no ``batching_strategy`` is provided, this
                can either be an integer specifying the number of samples to
                save in a batch (in which case ``batching_strategy`` is
                implicitly set to ``"static"``) or a float number of seconds
                between batched saves (in which case ``batching_strategy`` is
                implicitly set to ``"latency"``)
            batching_strategy (None): the batching strategy to use for each
                save operation. Supported values are:

                -   ``"static"``: a fixed sample batch size for each save
                -   ``"size"``: a target batch size, in bytes, for each save
                -   ``"latency"``: a target latency, in seconds, between saves

                By default, ``fo.config.default_batcher`` is used

        Returns:
            a :class:`SaveContext`
        """
        return SaveContext(
            self, batch_size=batch_size, batching_strategy=batching_strategy
        )
Returns a context that can be used to save samples from this
        collection according to a configurable batching strategy.

        Examples::

            import random as r
            import string as s

            import fiftyone as fo
            import fiftyone.zoo as foz

            dataset = foz.load_zoo_dataset("cifar10", split="test")

            def make_label():
                return "".join(r.choice(s.ascii_letters) for i in range(10))

            # No save context
            for sample in dataset.iter_samples(progress=True):
                sample.ground_truth.label = make_label()
                sample.save()

            # Save using default batching strategy
            with dataset.save_context() as context:
                for sample in dataset.iter_samples(progress=True):
                    sample.ground_truth.label = make_label()
                    context.save(sample)

            # Save in batches of 10
            with dataset.save_context(batch_size=10) as context:
                for sample in dataset.iter_samples(progress=True):
                    sample.ground_truth.label = make_label()
                    context.save(sample)

            # Save every 0.5 seconds
            with dataset.save_context(batch_size=0.5) as context:
                for sample in dataset.iter_samples(progress=True):
                    sample.ground_truth.label = make_label()
                    context.save(sample)

        Args:
            batch_size (None): the batch size to use. If a ``batching_strategy``
                is provided, this parameter configures the strategy as
                described below. If no ``batching_strategy`` is provided, this
                can either be an integer specifying the number of samples to
                save in a batch (in which case ``batching_strategy`` is
                implicitly set to ``"static"``) or a float number of seconds
                between batched saves (in which case ``batching_strategy`` is
                implicitly set to ``"latency"``)
            batching_strategy (None): the batching strategy to use for each
                save operation. Supported values are:

                -   ``"static"``: a fixed sample batch size for each save
                -   ``"size"``: a target batch size, in bytes, for each save
                -   ``"latency"``: a target latency, in seconds, between saves

                By default, ``fo.config.default_batcher`` is used

        Returns:
            a :class:`SaveContext`
        
fiftyone/core/collections.py