code: def _flatten_index(index: SeqStrType) -> Sequence[str]:
      if isinstance(index, str):
          return (index,)
      else:
          return tuple(
              itertools.chain.from_iterable(
                  [_flatten_index(y) for y in index]
              )
          )
  
imports: from collections import abc
  import itertools
  from typing import AbstractSet, Any, Dict, Generic, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Tuple, TypeVar, Union
  from ray.rllib.utils.annotations import ExperimentalAPI
label_desc: Use image node_id 1 for calling a global function with example usage: _flatten_index(index) and returns: index, tuple