code: def get_stage_ids(**kwargs):
      """Returns a list of stage ids.
  
      Args:
        **kwargs: A dictionary of
            'train_root_dir': A string of root directory of training logs.
            'num_resolutions': An integer of number of progressive resolutions.
      """
      train_sub_dirs = [
          sub_dir
          for sub_dir in tf.gfile.ListDirectory(
              kwargs["train_root_dir"]
          )
          if sub_dir.startswith("stage_")
      ]
  
      # If fresh start, start with start_stage_id = 0
      # If has been trained for n = len(train_sub_dirs) stages, start with the last
      # stage, i.e. start_stage_id = n - 1.
      start_stage_id = max(0, len(train_sub_dirs) - 1)
  
      return list(range(start_stage_id, get_total_num_stages(**kwargs)))
  
imports: import os
  import time
  from absl import logging
  from magenta.models.gansynth.lib import networks
  import numpy
  import tensorflow.compat.v1
  import tensorflow_gan
label_desc: Use image node_id 3 for calling a global function with example usage: get_stage_ids() and returns: list