code: def _get_flattened_data_list(
      data_list: Iterable[Any],
  ) -> List[BaseData]:
      outs: List[BaseData] = []
      for data in data_list:
          if isinstance(data, BaseData):
              outs.append(data)
          elif isinstance(data, (tuple, list)):
              outs.extend(_get_flattened_data_list(data))
          elif isinstance(data, dict):
              outs.extend(_get_flattened_data_list(data.values()))
      return outs
  
imports: import copy
  import os.path
  import re
  import sys
  import warnings
  from abc import ABC, abstractmethod
  from collections.abc import Sequence
  from typing import Any, Callable, Iterable, Iterator, List, Optional, Tuple, Union
  import numpy
  import torch.utils.data
  from torch import Tensor
  from torch_geometric.data.data import BaseData
  from torch_geometric.io import fs
label_desc: Use image node_id 5 for calling a global function with example usage: _get_flattened_data_list(data_list) and returns: outs