code: def test_learning_spec(
      self, learning_rate_spec, contains_node, not_containing
  ):
      # Force graph mode
      with tf.compat.v1.Graph().as_default():
          spec = phoenix_spec_pb2.PhoenixSpec(
              problem_type=phoenix_spec_pb2.PhoenixSpec.DNN
          )
          task_manager_instance = task_manager.TaskManager(
              spec,
              logits_dimension=None,
              loss_fn=loss_fns.make_multi_class_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"]
          )
          towers = {"search_generator": [fake_tower(logits_spec)]}
          features = {"x": tf.zeros([10, 10])}
          model = task_manager_instance.create_model_spec(
              features=features,
              params=hp.HParams(optimizer="sgd"),
              learning_rate_spec=learning_rate_spec,
              towers=towers,
              labels=tf.ones([20], dtype=tf.int32),
              mode=tf.estimator.ModeKeys.TRAIN,
              trial_mode=trial_utils.TrialMode.NO_PRIOR,
              my_id=1,
              model_directory=self.get_temp_dir(),
              use_tpu=False,
              predictions_fn=_default_predictions_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)
          self.assertIn("probabilities", model.predictions)
          self.assertIn("log_probabilities", model.predictions)
          self.assertIn("predictions", model.predictions)
  
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 1 for calling the TaskManagerTest obj's underlying member method code with example usage: obj.test_learning_spec(learning_rate_spec, contains_node, not_containing) without return types