code: def channel_dimension(shape, data_format, min_rank=1):
      """Returns the channel dimension of shape, while checking it has min_rank.
  
      Args:
        shape: A `TensorShape`.
        data_format: `channels_first` or `channels_last`.
        min_rank: Integer, minimum rank of shape.
  
      Returns:
        The value of the first dimension.
  
      Raises:
        ValueError: if inputs don't have at least min_rank dimensions, or if the
          first dimension value is not defined.
      """
      return _get_dimension(
          shape,
          1 if data_format == "channels_first" else -1,
          min_rank=min_rank,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import namedtuple
  from collections import OrderedDict
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variables
label_desc: Use image node_id 11 for calling a global function with example usage: channel_dimension(shape, data_format, min_rank) and returns: _get_dimension