code: def format_prompt(prompt, *format_args, **format_kwargs):
      # Format the content of all the messages if prompt is a list of messages, otherwise format the prompt string
      if isinstance(prompt, str):
          return prompt.format(*format_args, **format_kwargs)
      elif isinstance(prompt, list):
          return format_messages(prompt, *format_args, **format_kwargs)
  
file_path: evals/evals/elsuite/ballots/utils.py
imports: from typing import Optional
  import tiktoken
  from evals.elsuite.ballots.prompts import control_chat_prompt, control_text_template, manipulation_chat_template, manipulation_text_template, text_prompt, voter_chat_prompt, voter_text_prompt
  from evals.registry import is_chat_model
label_desc: Use image node_id 3 for calling a global function with example usage: format_prompt(prompt) and returns: prompt, format_messages