code: def _validate_choices(cls):
      for key in cls.__dataclass_fields__.keys():
          atr = cls.__dataclass_fields__[key]
          if atr.init and "choices" in atr.metadata.keys():
              if getattr(cls, key) not in atr.metadata.get("choices"):
                  raise ValueError(
                      f"{getattr(cls, key)} is not a valid choice for {key}."
                      f" Please choose from on of the following: {atr.metadata['choices']}"
                  )
  
imports: import os
  import re
  from dataclasses import MISSING, dataclass, field
  from typing import Any, Dict, Iterable, List, Optional
  from omegaconf import OmegaConf
  from pytorch_tabular.models.common import heads
  from pytorch_tabular.utils import get_logger
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_choices(cls) without return types