code: def _validate_average_method_arg(
      average_method: Literal[
          "min", "geometric", "arithmetic", "max"
      ] = "arithmetic"
  ) -> None:
      if average_method not in (
          "min",
          "geometric",
          "arithmetic",
          "max",
      ):
          raise ValueError(
              "Expected argument `average_method` to be one of  `min`, `geometric`, `arithmetic`, `max`,"
              f"but got {average_method}"
          )
  
file_path: torchmetrics/src/torchmetrics/functional/clustering/utils.py
imports: from typing import Optional, Union
  import torch
  from torch import Tensor, tensor
  from typing_extensions import Literal
  from torchmetrics.utilities.checks import _check_same_shape
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_average_method_arg(average_method) without return types