code: def convert_into_template(
      df, template, prompt_or_completion="prompt"
  ):
      validate_template(template)
      template = template.replace("\\n", "\n")
      field_names = parse_template(template)
      for field_name in field_names:
          if field_name not in df.columns:
              raise ValueError(
                  f"Field {field_name} requested in {prompt_or_completion}_template ({template}) but not found in file columns, which contains {list(df.columns)}"
              )
      df[prompt_or_completion] = df.apply(
          lambda row: template_mapper(row, field_names, template),
          axis=1,
      )
      return df
  
imports: import argparse
  import math
  import os
  import pathlib
  from collections import Counter
  import numpy
  import pandas
label_desc: Use image node_id 15 for calling a global function with example usage: convert_into_template(df, template, prompt_or_completion) and returns: df