code: def last_dimension(shape, min_rank=1):
      """Returns the last dimension of shape while checking it has min_rank.
  
      Args:
        shape: A `TensorShape`.
        min_rank: Integer, minimum rank of shape.
  
      Returns:
        The value of the last dimension.
  
      Raises:
        ValueError: if inputs don't have at least min_rank dimensions, or if the
          last dimension value is not defined.
      """
      return _get_dimension(shape, -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 12 for calling a global function with example usage: last_dimension(shape, min_rank) and returns: _get_dimension