code: def _nested_stack(sequence: List[Any]):
      """Stack nested elements in a sequence."""
      return tree.map_structure(lambda *x: np.stack(x), *sequence)
  
imports: from typing import Any, List
  from absl import flags
  from bsuite.environments import deep_sea
  import dm_env
  import numpy
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling a global function with example usage: _nested_stack(sequence) and returns: tree