code: def _binary_hinge_loss_arg_validation(
      squared: bool, ignore_index: Optional[int] = None
  ) -> None:
      if not isinstance(squared, bool):
          raise ValueError(
              f"Expected argument `squared` to be an bool but got {squared}"
          )
      if ignore_index is not None and not isinstance(ignore_index, int):
          raise ValueError(
              f"Expected argument `ignore_index` to either be `None` or an integer, but got {ignore_index}"
          )
  
file_path: torchmetrics/src/torchmetrics/functional/classification/hinge.py
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor, tensor
  from typing_extensions import Literal
  from torchmetrics.functional.classification.confusion_matrix import _binary_confusion_matrix_format, _binary_confusion_matrix_tensor_validation, _multiclass_confusion_matrix_format, _multiclass_confusion_matrix_tensor_validation
  from torchmetrics.utilities.data import to_onehot
  from torchmetrics.utilities.enums import ClassificationTaskNoMultilabel
label_desc: Use image node_id 2 for calling a global function with example usage: _binary_hinge_loss_arg_validation(squared, ignore_index) without return types