def get_num_macrotasks_in_stage(conf, stage_num):
  """Finds the number of Macrotasks in a Stage.

  Returns:
    The number of Macrotasks in the Stage with the provided index, extracted from the provided
    SimulatorConf.
  """
  return len(conf.jobs[0].stages[stage_num].macrotasks)