def parse_batching_strategy(batch_size=None, batching_strategy=None):
    """Parses the given batching strategy configuration, applying any default
    config settings as necessary.

    Args:
        batch_size (None): the batch size to use. If a ``batching_strategy`` is
            provided, this parameter configures that 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 tuple of ``(batch_size, batching_strategy)``
    """
    if batching_strategy is None:
        if batch_size is None:
            batching_strategy = fo.config.default_batcher
        elif isinstance(batch_size, numbers.Integral):
            batching_strategy = "static"
        elif isinstance(batch_size, numbers.Number):
            batching_strategy = "latency"
        else:
            raise ValueError(
                "Unsupported batch size %s; must be an integer or float"
                % batch_size
            )

    supported_batching_strategies = ("static", "size", "latency")
    if batching_strategy not in supported_batching_strategies:
        raise ValueError(
            "Unsupported batching strategy '%s'; supported values are %s"
            % (batching_strategy, supported_batching_strategies)
        )

    if batch_size is None:
        if batching_strategy == "static":
            batch_size = fo.config.batcher_static_size
        elif batching_strategy == "size":
            batch_size = fo.config.batcher_target_size_bytes
        elif batching_strategy == "latency":
            batch_size = fo.config.batcher_target_latency

    return batch_size, batching_strategy
Parses the given batching strategy configuration, applying any default
    config settings as necessary.

    Args:
        batch_size (None): the batch size to use. If a ``batching_strategy`` is
            provided, this parameter configures that 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 tuple of ``(batch_size, batching_strategy)``
    
fiftyone/core/utils.py