code: def _get_template_fields(
      template: str,
  ) -> Tuple[Set[str], Dict[str, Type]]:
      """Returns the fields in the template."""
      parsed = [
          t
          for t in string.Formatter().parse(template)
          if t[1] is not None
      ]
      field_set = {field for _, field, _, _ in parsed}
      dtype_map = {
          field: _get_dtype(format_spec)
          for _, field, format_spec, _ in parsed
      }
      return field_set, dtype_map
  
file_path: ludwig/ludwig/data/prompt.py
imports: import json
  import logging
  import os
  import string
  from typing import Any, Dict, List, Optional, Set, Tuple, Type, TYPE_CHECKING
  import pandas
  from ludwig.models.retrieval import df_checksum, get_retrieval_model, RetrievalModel
  from ludwig.utils.fs_utils import get_default_cache_location, makedirs, path_exists
  from ludwig.utils.types import DataFrame, Series
label_desc: Use image node_id 4 for calling a global function with example usage: _get_template_fields(template) and returns: field_set,  dtype_map