code: def arguments_common(
      parser: argparse.ArgumentParser,
  ) -> argparse.ArgumentParser:
      group = parser.add_argument_group(
          title="Common arguments", description="Common arguments"
      )
  
      group.add_argument(
          "--taskname",
          type=str,
          default="",
          help="Name of the task (can have arbitrary values)",
      )
      group.add_argument(
          "--common.seed", type=int, default=0, help="Random seed"
      )
      group.add_argument(
          "--common.config-file",
          type=str,
          default=None,
          help="Configuration file",
      )
      group.add_argument(
          "--common.results-loc",
          type=str,
          default="results",
          help="Directory where results will be stored",
      )
      group.add_argument(
          "--common.run-label",
          type=str,
          default="run_1",
          help="Label id for the current run",
      )
      group.add_argument(
          "--common.eval-stage-name",
          type=str,
          default="evaluation",
          help="Name to be used while logging in evaluation stage.",
      )
  
      group.add_argument(
          "--common.resume",
          type=str,
          default=None,
          help="Resume location",
      )
      group.add_argument(
          "--common.finetune",
          type=str,
          default=None,
          help="Checkpoint location to be used for finetuning",
      )
      group.add_argument(
          "--common.finetune-ema",
          type=str,
          default=None,
          help="EMA Checkpoint location to be used for finetuning",
      )
  
      group.add_argument(
          "--common.mixed-precision",
          action="store_true",
          help="Mixed precision training",
      )
      group.add_argument(
          "--common.mixed-precision-dtype",
          type=str,
          default="float16",
          help="Mixed precision training data type",
      )
      group.add_argument(
          "--common.accum-freq",
          type=int,
          default=1,
          help="Accumulate gradients for this number of iterations",
      )
      group.add_argument(
          "--common.accum-after-epoch",
          type=int,
          default=0,
          help="Start accumulation after this many epochs",
      )
      group.add_argument(
          "--common.log-freq",
          type=int,
          default=100,
          help="Display after these many iterations",
      )
      group.add_argument(
          "--common.auto-resume",
          action="store_true",
          help="Resume training from the last checkpoint",
      )
      group.add_argument(
          "--common.grad-clip",
          type=float,
          default=None,
          help="Gradient clipping value",
      )
      group.add_argument(
          "--common.k-best-checkpoints",
          type=int,
          default=5,
          help="Keep k-best checkpoints",
      )
      group.add_argument(
          "--common.save-all-checkpoints",
          action="store_true",
          default=False,
          help="If True, will save checkpoints from all epochs",
      )
  
      group.add_argument(
          "--common.inference-modality",
          type=str,
          default="image",
          choices=SUPPORTED_MODALITIES,
          help="Inference modality. Image or videos",
      )
  
      group.add_argument(
          "--common.channels-last",
          action="store_true",
          default=False,
          help="Use channel last format during training. "
          "Note 1: that some models may not support it, so we recommend to use it with caution"
          "Note 2: Channel last format does not work with 1-, 2-, and 3- tensors. "
          "Therefore, we support it via custom collate functions",
      )
  
      group.add_argument(
          "--common.tensorboard-logging",
          action="store_true",
          help="Enable tensorboard logging",
      )
      group.add_argument(
          "--common.override-kwargs",
          nargs="*",
          action=ParseKwargs,
          help="Override arguments. Example. To override the value of --sampler.vbs.crop-size-width, "
          "we can pass override argument as "
          "--common.override-kwargs sampler.vbs.crop_size_width=512 \n "
          "Note that keys in override arguments do not contain -- or -",
      )
  
      group.add_argument(
          "--common.enable-coreml-compatible-module",
          action="store_true",
          help="Use coreml compatible modules (if applicable) during inference",
      )
  
      group.add_argument(
          "--common.debug-mode",
          action="store_true",
          help="You can use this flag for debugging purposes.",
      )
  
      # intermediate checkpoint related args
      group.add_argument(
          "--common.save-interval-freq",
          type=int,
          default=0,
          help="Save checkpoints every N updates. Defaults to 0",
      )
  
      try:
          from internal.utils.opts import arguments_internal
  
          parser = arguments_internal(parser=parser)
      except ModuleNotFoundError:
          logger.debug("Cannot load internal arguments, skipping.")
  
      return parser
  
imports: import argparse
  from typing import List, Optional
  from common import SUPPORTED_MODALITIES
  from cvnets import modeling_arguments
  from data.collate_fns import arguments_collate_fn
  from data.datasets import arguments_dataset
  from data.sampler import add_sampler_arguments
  from data.text_tokenizer import arguments_tokenizer
  from data.transforms import arguments_augmentation
  from data.video_reader import arguments_video_reader
  from loss_fn import add_loss_fn_arguments
  from metrics import METRICS_REGISTRY, arguments_stats
  from optim import arguments_optimizer
  from optim.scheduler import arguments_scheduler
  from options.utils import load_config_file
  from utils import logger
label_desc: Use image node_id 1 for calling a global function with example usage: arguments_common(parser) and returns: parser