code: def check_bids_label(label):
      """Validate a BIDS label.
  
      https://bids-specification.readthedocs.io/en/stable/glossary.html#label-formats # noqa
  
      Parameters
      ----------
      label : Any
          Label to validate
  
      """
      if not isinstance(label, str):
          raise TypeError(
              f"All bids labels must be string. "
              f"Got '{type(label)}' for {label} instead."
          )
      if not all(char.isalnum() for char in label):
          raise ValueError(
              f"All bids labels must be alphanumeric. Got '{label}' instead."
          )
  
imports: from __future__ import annotations
label_desc: Use image node_id 2 for calling a global function with example usage: check_bids_label(label) without return types