class_docstr: Handle for dealing with environment (and especially multi-agent) outputs more easily
class_docstr_tok: ["Handle","for","dealing","with","environment","(","and","especially","multi-agent",")","outputs","more","easily"]
code: def to_multiagent_step(
      outcomes: tp.Dict[str, "StepOutcome"], done: bool = False
  ) -> StepReturn:
      names = ["observation", "reward", "done", "info"]
      obs, reward, done_dict, info = (
          {
              agent: getattr(outcome, name)
              for agent, outcome in outcomes.items()
          }
          for name in names
      )
      done_dict["__all__"] = done
      return obs, reward, done_dict, info
  
imports: import typing
  from collections import defaultdict
  import gym
label_desc: Use image node_id 5 for calling the StepOutcome obj's underlying member method code with example usage: obj.to_multiagent_step(outcomes, done) and returns: obs,  reward,  done_dict,  info