code: def add_epoch_number(batch, epoch):
      """
      Add the epoch number to the batch instances as a MetadataField.
      """
      for instance in batch.instances:
          instance.fields["epoch_num"] = MetadataField(epoch)
      return batch
  
imports: from __future__ import division
  from __future__ import absolute_import
  import logging
  from collections import defaultdict
  import itertools
  import math
  import random
  import torch
  from allennlp.common.registrable import Registrable
  from allennlp.common.util import is_lazy, lazy_groups_of, ensure_list
  from allennlp.data.dataset import Batch
  from allennlp.data.fields import MetadataField
  from allennlp.data.instance import Instance
  from allennlp.data.vocabulary import Vocabulary
label_desc: Use image node_id 1 for calling a global function with example usage: add_epoch_number(batch, epoch) and returns: batch