code: def convert_to_tuple_of_two_int(value, name):
      """Transforms iterable of 2 integers into an tuple of 2 integers.
  
      Args:
        value: A iterable of 2 ints.
        name: The name of the argument being validated, e.g., sparsity_m_by_n.
  
      Returns:
        A tuple of 2 integers.
  
      Raises:
        ValueError: If something else than an iterable of ints was passed.
      """
      try:
          value_tuple = tuple(value)
      except TypeError:
          raise ValueError(
              f"The {name} argument must be a tuple/list of 2 integers."
              f"received: {str(value)}."
          ) from None
      if len(value_tuple) != 2:
          raise ValueError(
              f"The {name} argument must be a tuple/list of 2 integers."
              f"received: {str(value)}."
          )
      for single_value in value_tuple:
          if not isinstance(single_value, int):
              raise ValueError(
                  f"The {name} argument must be a tuple/list of 2 integers."
                  f"received: {str(value)} including element {str(single_value)} "
                  f"of type {str(type(single_value))}."
              )
  
      return value_tuple
  
file_path: model-optimization/tensorflow_model_optimization/python/core/sparsity/keras/pruning_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: convert_to_tuple_of_two_int(value, name) and returns: value_tuple