code: def make_choice_type_function(choices: list) -> Callable[[str], Any]:
      """
      Creates a mapping function from each choices string representation to the actual value. Used to support multiple
      value types for a single argument.
  
      Args:
          choices (list): List of choices.
  
      Returns:
          Callable[[str], Any]: Mapping function from string representation to actual value for each choice.
      """
      str_to_choice = {str(choice): choice for choice in choices}
      return lambda arg: str_to_choice.get(arg, arg)
  
imports: import dataclasses
  import json
  import sys
  import types
  from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, ArgumentTypeError
  from copy import copy
  from enum import Enum
  from inspect import isclass
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Literal, NewType, Optional, Tuple, Union, get_type_hints
  import yaml
label_desc: Use image node_id 2 for calling a global function with example usage: make_choice_type_function(choices) and returns: function