docstr: This property handles how subparsers are created, which are only needed when registering a subcommand.
  If `self` does not have any subcommand, no subparsers should be created or it will mess with the command.
  This property ensures that we create subparsers only if needed.
docstr_tok: ["This","property","handles","how","subparsers","are","created",",","which","are","only","needed","when","registering","a","subcommand",".","If","`","self","`","does","not","have","any","subcommand",",","no","subparsers","should","be","created","or","it","will","mess","with","the","command",".","This","property","ensures","that","we","create","subparsers","only","if","needed","."]
code: def subparsers(self):
      """
      This property handles how subparsers are created, which are only needed when registering a subcommand.
      If `self` does not have any subcommand, no subparsers should be created or it will mess with the command.
      This property ensures that we create subparsers only if needed.
      """
      subparsers = getattr(self, "_subparsers", None)
      if subparsers is None:
          if self.SUBCOMMANDS:
              self._subparsers = self.parser.add_subparsers()
          else:
              self._subparsers = None
      return self._subparsers
  
file_path: optimum/optimum/commands/base.py
imports: from abc import ABC
  from argparse import ArgumentParser, RawTextHelpFormatter
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, Optional, Tuple, Type
label_desc: Use image node_id 2 for calling the BaseOptimumCLICommand obj's underlying member method code with example usage: obj.subparsers() and returns: self