code: def _fix_axis_dim_pairs(pairs, name):
      """Helper function to make `pairs` a list if needed."""
      if isinstance(pairs[0], int):
          pairs = [pairs]
      for pair in pairs:
          if len(pair) != 2:
              raise ValueError(
                  "{} must consist of axis-value pairs, but found {}".format(
                      name, pair
                  )
              )
      return pairs
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import six
  from six.moves import range
  from six.moves import zip
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: _fix_axis_dim_pairs(pairs, name) and returns: pairs