code: def _partition(episodes):
      
  
      from ray.rllib.evaluation.sampler import RolloutMetrics
  
      rollouts, estimates = [], []
      for e in episodes:
          if isinstance(e, RolloutMetrics):
              rollouts.append(e)
          elif isinstance(e, OffPolicyEstimate):
              estimates.append(e)
          else:
              raise ValueError("Unknown metric type: {}".format(e))
      return rollouts, estimates
docs: Divides metrics data into true rollouts vs off-policy estimates.