code: def create_multi_ranking_head(
      heads, head_weights=None, optimizer=None, train_op_fn=None
  ):
      """A factory method to create `_MultiRankingHead`.
  
      Args:
        heads: A tuple or list of `_RankingHead`.
        head_weights: A tuple or list of weights.
        optimizer: If not None, use this optimizer instead of the first head's
          optimizer.
        train_op_fn: If not None, use this train_op_fn instead of the first
          head's train_op_fn.
  
      Returns:
        An instance of `_MultiRankingHead` for multi-task learning.
      """
      return _MultiRankingHead(
          heads, head_weights, optimizer, train_op_fn
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import six
  import tensorflow
  from tensorflow import estimator
label_desc: Use image node_id 2 for calling a global function with example usage: create_multi_ranking_head(heads, head_weights, optimizer, train_op_fn) and returns: _MultiRankingHead