code: def get_number_of_towers(directory, generator_name):
      """Given a trial directory and a generator name, returns the number of towers.
  
      Args:
        directory: string - a model directory (that includes checkpoints).
        generator_name: string - the generator name that built the towers.
  
      Returns:
        np.array of ints - holding the number of towers (one integer) the generator
          created.
      """
      checkpoint = tf.train.latest_checkpoint(directory)
      reader = tf.compat.v1.train.NewCheckpointReader(checkpoint)
      return reader.get_tensor(
          NUMBER_OF_TOWERS + "/{}".format(generator_name)
      )
  
imports: import collections
  import os
  import string
  import time
  from absl import flags
  from absl import logging
  from model_search import block
  from model_search import block_builder
  from model_search import hparam
  from model_search import utils
  from model_search.proto import hparam_pb2
  from model_search.proto import phoenix_spec_pb2
  from model_search.proto import transfer_learning_spec_pb2
  import numpy
  import tensorflow.compat.v2
  import tf_slim
  from google.protobuf import text_format
label_desc: Use image node_id 8 for calling a global function with example usage: get_number_of_towers(directory, generator_name) and returns: reader