code: def _normalize_index_to_list(self, index, query):
      # Ensure to have a list of index
      if index is None:
          searchable_indexes = self.__documents_dict.keys()
      elif isinstance(index, str):
          searchable_indexes = [index]
      elif isinstance(index, list):
          searchable_indexes = index
      else:
          # Is it the correct exception to use ?
          raise ValueError("Invalid param 'index'")
  
      generator = (
          target
          for index in searchable_indexes
          for target in index.split(",")
      )
      return list(self._validate_search_targets(generator, query=query))
  
imports: from __future__ import annotations
  import fnmatch
  import json
  from elasticsearch import Elasticsearch
  from elasticsearch.exceptions import NotFoundError
  from .utilities import MissingIndexException, get_random_id, query_params
label_desc: Use image node_id 18 for calling the FakeElasticsearch obj's underlying member method code with example usage: obj._normalize_index_to_list(index, query) and returns: list