code: def _convert_all_to_str(structure):
      if isinstance(structure, types.GeneratorType):
          return tree.map_structure(_convert_to_str, list(structure))
      else:
          return tree.map_structure(_convert_to_str, structure)
  
file_path: pysc2/pysc2/lib/replay/sc2_replay.py
imports: import io
  import json
  import types
  import mpyq
  from s2protocol import versions
  import tree
label_desc: Use image node_id 2 for calling a global function with example usage: _convert_all_to_str(structure) and returns: tree, tree