code: def add_parser(parser):
      """
      Add a tempo evaluation sub-parser to an existing parser.
  
      Parameters
      ----------
      parser : argparse parser instance
          Existing argparse parser object.
  
      Returns
      -------
      sub_parser : argparse sub-parser instance
          Tempo evaluation sub-parser.
      parser_group : argparse argument group
          Tempo evaluation argument group.
  
      """
      import argparse
  
      # add tempo evaluation sub-parser to the existing parser
      p = parser.add_parser(
          "tempo",
          help="tempo evaluation",
          formatter_class=argparse.RawDescriptionHelpFormatter,
          description="""
      This program evaluates pairs of files containing the tempo annotations and
      detections. Suffixes can be given to filter them from the list of files.
  
      A single line represents the tempi and their relative strength and must
      have the following format with values being separated by whitespace:
      `tempo_one tempo_two relative_strength`
  
      Lines starting with # are treated as comments and are ignored.
  
      For P-Score evaluation as many tempi detections are used as tempo
      annotations are given.
  
      For Accuracy 1 & 2 evaluation, only the strongest (if strengths are given)
      or the first tempo is used.
  
      """,
      )
      # set defaults
      p.set_defaults(
          eval=TempoEvaluation,
          mean_eval=TempoMeanEvaluation,
          sum_eval=None,
          load_fn=load_tempo,
      )
      # file I/O
      evaluation_io(p, ann_suffix=".bpm", det_suffix=".bpm.txt")
      # evaluation parameters
      g = p.add_argument_group("tempo manipulation arguments")
      g.add_argument(
          "--tolerance",
          type=float,
          action="store",
          default=TOLERANCE,
          help="tolerance for tempo detection "
          "[default=%(default).3f]",
      )
      g.add_argument(
          "--no_double",
          dest="double",
          action="store_false",
          help="do not include double/half tempo evaluation",
      )
      g.add_argument(
          "--no_triple",
          dest="triple",
          action="store_false",
          help="do not include triple/third tempo evaluation",
      )
      # how many and which of the tempi should be evaluated?
      g.add_argument(
          "--no_sort",
          dest="sort",
          action="store_false",
          help="do not sort the tempi by strength [default: sort "
          "them by strength]",
      )
      # TODO: add option to evaluate any other than the default number of tempi?
      # g.add_argument('--num', dest='max_len', action='store', type=int,
      #                help='evaluate NUM tempi [default: evaluate only the '
      #                     'first (after sorting them)]')
      # return the sub-parser and evaluation argument group
      return p, g
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  import numpy
  from .None import EvaluationMixin, MeanEvaluation, evaluation_io
  from ..io import load_tempo
label_desc: Use image node_id 3 for calling a global function with example usage: add_parser(parser) and returns: p,  g