code: def _all_finite_integers(mutable: Mutable) -> List[int]:
      all_values = list(mutable.grid())
      all_values_fine_grained = list(mutable.grid(granularity=2))
      if all_values != all_values_fine_grained:
          raise ValueError(
              f"Invalid depth choice: {mutable}. "
              f"Only support discrete values, but some variables might be continuous."
          )
      if not all(isinstance(val, int) for val in all_values):
          raise ValueError(
              f"Invalid depth choice: {mutable}. "
              f"Only choice of integers. But some choices are not: {all_values}"
          )
      return all_values
  
imports: import copy
  import logging
  import warnings
  from contextlib import contextmanager
  from typing import Callable, List, Union, Tuple, Optional, cast
  import torch
  import torch.nn
  from nni.mutable import Categorical, LabeledMutable, Mutable, Sample, SampleValidationError, ensure_frozen
  from nni.mutable.mutable import MutableExpression
  from nni.mutable.symbol import SymbolicExpression
  from .base import MutableModule, recursive_freeze
label_desc: Use image node_id 2 for calling a global function with example usage: _all_finite_integers(mutable) and returns: all_values