code: def _compute_spi_from_replay_fraction(
      replay_fraction: float,
  ) -> float:
      """Computes an estimated samples_per_insert from a replay_fraction.
  
      Assumes actors simultaneously add to both the queue and replay in a mixed
      replay setup. Since the online queue sets samples_per_insert = 1, then the
      total SPI can be calculated as:
  
        SPI = B / O = O / (1 - f) / O = 1 / (1 - f).
  
      Key:
        B: total batch size
        O: online batch size
        f: replay fraction.
  
      Args:
        replay_fraction: fraction of a batch size taken from replay (as opposed to
          the queue of online experience) in a mixed replay setting.
  
      Returns:
        An estimate of the samples_per_insert value to produce comparable runs in
        the pure replay setting.
      """
      return 1 / (1 - replay_fraction)
  
file_path: acme/acme/agents/jax/mpo/config.py
imports: import dataclasses
  from typing import Callable, Optional, Union
  from acme import types
  from acme.agents.jax.mpo import types
  import numpy
  import rlax
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_spi_from_replay_fraction(replay_fraction) and returns: unknown