code: def scorers_from_opts(opt):
      if opt.early_stopping_criteria is None:
          return DEFAULT_SCORERS
      else:
          scorers = []
          for criterion in set(opt.early_stopping_criteria):
              assert (
                  criterion in SCORER_BUILDER.keys()
              ), "Criterion {} not found".format(criterion)
              scorers.append(SCORER_BUILDER[criterion]())
          return scorers
  
imports: from enum import Enum
  from onmt.utils.logging import logger
label_desc: Use image node_id 1 for calling a global function with example usage: scorers_from_opts(opt) and returns: DEFAULT_SCORERS, scorers