code: def debatch_actor_ids(actor_ids: List[ActorID]) -> List[ActorID]:
      """If actor ids are returned by the dataloader they are batched in the step_key and agent_id fields. Since a single
      batch of value should correlate in agent_id and step key, this holds redundant information and should be
      reversed for it to work properly with all other parts of the framework.
      """
      for idx in range(len(actor_ids)):
          actor_id_tmp = actor_ids[idx]
          if isinstance(
              actor_id_tmp.agent_id, torch.Tensor
          ) and isinstance(actor_id_tmp.step_key, torch.Tensor):
              assert (
                  len(set(actor_id_tmp.agent_id.tolist())) == 1
              ), actor_id_tmp.agent_id
              assert (
                  len(set(actor_id_tmp.step_key.tolist())) == 1
              ), actor_id_tmp.step_key
              actor_ids[idx] = ActorID(
                  step_key=actor_id_tmp.step_key[0].item(),
                  agent_id=actor_id_tmp.agent_id[0].item(),
              )
          elif isinstance(actor_id_tmp.agent_id, int) and isinstance(
              actor_id_tmp.step_key, (int, str)
          ):
              pass
          else:
              raise NotImplementedError(
                  f"Not implemented batched actor id type found: {type(actor_id_tmp.agent_id)}"
              )
  
      return actor_ids
  
file_path: maze/maze/train/utils/train_utils.py
imports: from collections import defaultdict
  from typing import List, Dict, Iterable, Union
  import numpy
  import torch
  from maze.core.env.structured_env import ActorID
label_desc: Use image node_id 6 for calling a global function with example usage: debatch_actor_ids(actor_ids) and returns: actor_ids