code: def test_multitask(
      self,
      learning_rate_spec,
      contains_node,
      not_containing,
      multi_loss=False,
      multi_prediction=False,
      merge_losses=False,
  ):
      # Force graph mode
      with tf.compat.v1.Graph().as_default():
          spec = phoenix_spec_pb2.PhoenixSpec(
              problem_type=phoenix_spec_pb2.PhoenixSpec.DNN
          )
          text_format.Merge(
              """
            multi_task_spec {
              label_name: "label1"
              number_of_classes: 10
            }
  
            multi_task_spec {
              label_name: "label2"
              number_of_classes: 10
            }
        """,
              spec,
          )
          spec.merge_losses_of_multitask = merge_losses
          loss_fn = loss_fns.make_multi_class_loss_fn()
          if multi_loss:
              loss_fn = {
                  "label1": loss_fns.make_multi_class_loss_fn(),
                  "label2": loss_fns.make_multi_class_loss_fn(),
              }
          task_manager_instance = task_manager.TaskManager(
              spec, logits_dimension=None, loss_fn=loss_fn, head=None
          )
          logits = tf.keras.layers.Dense(10)(tf.zeros([20, 10]))
          logits_spec = architecture_utils.LogitsSpec(logits=logits)
          fake_tower = collections.namedtuple(
              "fake_tower", ["logits_spec", "previous_model_dir"]
          )
          towers = {"search_generator": [fake_tower(logits_spec, None)]}
          features = {"x": tf.zeros([10, 10])}
          prediction_fn = _default_predictions_fn
          if multi_prediction:
              prediction_fn = {
                  "label1": _default_predictions_fn,
                  "label2": _default_predictions_fn,
              }
          model = task_manager_instance.create_model_spec(
              features=features,
              params=hp.HParams(optimizer="sgd"),
              learning_rate_spec=learning_rate_spec,
              towers=towers,
              labels={
                  "label1": tf.ones([20], dtype=tf.int32),
                  "label2": tf.ones([20], dtype=tf.int32),
              },
              my_id=1,
              model_directory=self.get_temp_dir(),
              mode=tf.estimator.ModeKeys.TRAIN,
              trial_mode=trial_utils.TrialMode.NO_PRIOR,
              use_tpu=False,
              predictions_fn=prediction_fn,
          )
          self.assertNotEmpty(
              [
                  node.name
                  for node in tf.compat.v1.get_default_graph()
                  .as_graph_def()
                  .node
                  if contains_node in node.name
              ]
          )
          for phrase in not_containing:
              self.assertEmpty(
                  [
                      node.name
                      for node in tf.compat.v1.get_default_graph()
                      .as_graph_def()
                      .node
                      if phrase in node.name
                  ]
              )
          self.assertLen(model.predictions, 3 * (1 + 2))
          self.assertContainsSubset(
              [
                  "probabilities",
                  "probabilities/label1",
                  "probabilities/label2",
                  "log_probabilities",
                  "log_probabilities/label1",
                  "log_probabilities/label2",
                  "predictions",
                  "predictions/label1",
                  "predictions/label2",
              ],
              model.predictions.keys(),
          )
  
imports: import collections
  from absl.testing import parameterized
  from model_search import hparam
  from model_search import loss_fns
  from model_search import task_manager
  from model_search.architecture import architecture_utils
  from model_search.generators import trial_utils
  from model_search.proto import phoenix_spec_pb2
  import numpy
  import tensorflow.compat.v2
  from google.protobuf import text_format
label_desc: Use image node_id 5 for calling the TaskManagerTest obj's underlying member method code with example usage: obj.test_multitask(learning_rate_spec, contains_node, not_containing, multi_loss, multi_prediction, merge_losses) without return types