code: def fill_query(
      query: List[str],
      entity_comb: List[str],
      type_comb: List[str],
      rel_comb: List[Tuple[str, float]],
      map_query_str_to_kb,
  ) -> List[str]:
      """example of query: ["wd:E1", "p:R1", "?s"]
                 entity_comb: ["Q159"]
                 type_comb: []
                 rel_comb: ["P17"]
      map_query_str_to_kb = [("P0", "http://wd"),
                             ("P00", "http://wl"),
                             ("wd:", "http://we/"),
                             ("wdt:", "http://wpd/"),
                             (" p:", " http://wp/"),
                             ("ps:", "http://wps/"),
                             ("pq:", "http://wpq/")]
      """
      query = " ".join(query)
  
      for query_str, wikidata_str in map_query_str_to_kb:
          query = query.replace(query_str, wikidata_str)
      query = fill_slots(query, entity_comb, type_comb, rel_comb)
      query = query.replace("http://wpd/P0", "http://wd")
      query = query.replace("http://wpd/P00", "http://wl")
      query = query.split(" ")
      return query
  
file_path: DeepPavlov/deeppavlov/models/kbqa/utils.py
imports: import itertools
  import re
  from collections import namedtuple
  from typing import List, Tuple, Dict, Any
label_desc: Use image node_id 9 for calling a global function with example usage: fill_query(query, entity_comb, type_comb, rel_comb, map_query_str_to_kb) and returns: query