code: def add_train_command(subparsers):
      # Train
      subparser = subparsers.add_parser(
          "train", help="Training with NNP."
      )
      subparser.add_argument(
          "-r",
          "--resume",
          help="Resume from last saved parameter",
          action="store_true",
      )
      subparser.add_argument(
          "-c", "--config", help="Path to nntxt", required=True
      )
      subparser.add_argument(
          "-p", "--param", help="Path to parameter file", required=False
      )
      subparser.add_argument(
          "-o", "--outdir", help="Output directory", required=True
      )
      subparser.add_argument(
          "-O",
          "--enable-ooc",
          help="Enable Out Of Core training",
          action="store_true",
      )
      subparser.add_argument(
          "-m",
          "--ooc-gpu-memory-size",
          help="OOC gpu memory size (INTEGER or NUMeNUM or NUM[KkMmGgTtPp])",
          default=None,
      )
      subparser.add_argument(
          "-C",
          "--context",
          help="Force exec context (cpu or cudnn[:DEVID])",
          default=None,
      )
      subparser.add_argument(
          "-w",
          "--ooc-window-length",
          help="OOC window length (INTEGER or NUMeNUM or NUM[KkMmGgTtPp])",
          default=None,
      )
      callback.add_train_command_arg(subparser)
      subparser.set_defaults(func=train_command)
  
imports: import glob
  import os
  import time
  import zipfile
  from collections import OrderedDict
  import nnabla
  import nnabla.utils.callback
  import nnabla.utils.load
  import numpy
  from contextlib2 import ExitStack
  from nnabla import available_contexts
  from nnabla.config import nnabla_config
  from nnabla.logger import logger
  from nnabla.parameter import save_parameters
  from nnabla.utils.cli.utility import NodeTimeInfoCollector
  from nnabla.utils.cli.utility import get_cpu_gpu_average_load
  from nnabla.utils.cli.utility import let_data_to_variable
  from nnabla.utils.cli.utility import lms_scheduler
  from nnabla.utils.cli.utility import load_train_state
  from nnabla.utils.cli.utility import measure_cpu_gpu_instant_load
  from nnabla.utils.cli.utility import save_optimizer_states
  from nnabla.utils.cli.utility import str_to_num
  from nnabla.utils.communicator_util import current_communicator, single_or_rankzero
  from nnabla.utils.nnp_format import nnp_version
  from nnabla.utils.progress import configure_progress, progress
  from six.moves import range
label_desc: Use image node_id 11 for calling a global function with example usage: add_train_command(subparsers) without return types