code: def validate_accelerator_count(accel: Accelerator, count: int) -> int:
      """Raises an error if the count isn't valid for the supplied accelerator, else
      returns the count.
  
      """
      is_gpu = accel in GPU
      ucase = accelerator_name(is_gpu)
      valid_counts = accelerator_counts(accel)
      if not _AccelCountMT[accel].get(count):
          raise argparse.ArgumentTypeError(
              with_advice_suffix(
                  accel,
                  "{} {}s of type {} aren't available \
  for any machine type. Try one of the following counts: {}\n".format(
                      count, ucase, accel.name, valid_counts
                  ),
              )
          )
  
      return count
  
imports: import argparse
  from enum import Enum
  from typing import Callable, List, NamedTuple, Optional, Set, Union
  import caliban.util
label_desc: Use image node_id 6 for calling a global function with example usage: validate_accelerator_count(accel, count) and returns: count