code: def query_from_triplets(
      query_triplets: List[str],
      answer_ent: List[str],
      query_info: Dict[str, str],
  ) -> str:
      filled_query = " . ".join(query_triplets)
      if answer_ent and answer_ent[0].lower().startswith("count"):
          filled_query = (
              f"SELECT COUNT({query_info['unk_var']}) "
              + f"WHERE {{ {filled_query}. }}"
          )
      else:
          filled_query = f"SELECT {query_info['unk_var']} WHERE {{ {filled_query}. }}"
      filled_query = filled_query.replace(" ..", ".")
      return filled_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 8 for calling a global function with example usage: query_from_triplets(query_triplets, answer_ent, query_info) and returns: filled_query