code: def add_parser(subparsers, parent_parser):
      STUDIO_HELP = "Commands to authenticate DVC with Iterative Studio"
      STUDIO_DESCRIPTION = (
          "Authenticate DVC with Studio and set the token."
          " Once this token has been properly configured,\n"
          " DVC will utilize it for seamlessly sharing live experiments\n"
          " and sending notifications to Studio regarding any experiments"
          " that have been pushed."
      )
  
      studio_parser = subparsers.add_parser(
          "studio",
          parents=[parent_parser],
          description=append_doc_link(STUDIO_DESCRIPTION, "studio"),
          help=STUDIO_HELP,
          formatter_class=formatter.RawDescriptionHelpFormatter,
      )
      studio_subparser = studio_parser.add_subparsers(
          dest="cmd",
          help="Use `DVC studio CMD --help` to display command-specific help.",
          required=True,
      )
  
      STUDIO_LOGIN_HELP = "Authenticate DVC with Studio host"
      STUDIO_LOGIN_DESCRIPTION = (
          "By default, this command authenticates the DVC with Studio\n"
          " using default scopes and assigns a random name as the token name."
      )
      login_parser = studio_subparser.add_parser(
          "login",
          parents=[parent_parser],
          description=append_doc_link(
              STUDIO_LOGIN_DESCRIPTION, "studio/login"
          ),
          help=STUDIO_LOGIN_HELP,
          formatter_class=formatter.RawDescriptionHelpFormatter,
      )
  
      login_parser.add_argument(
          "-H",
          "--hostname",
          action="store",
          default=None,
          help="The hostname of the Studio instance to authenticate with.",
      )
      login_parser.add_argument(
          "-s",
          "--scopes",
          action="store",
          default=None,
          help="The scopes for the authentication token. ",
      )
  
      login_parser.add_argument(
          "-n",
          "--name",
          action="store",
          default=None,
          help="The name of the authentication token. It will be used to\n"
          "identify token shown in Studio profile.",
      )
  
      login_parser.add_argument(
          "--no-open",
          action="store_true",
          default=False,
          help="Use authentication flow based on user code.\n"
          "You will be presented with user code to enter in browser.\n"
          "DVC will also use this if it cannot launch browser on your behalf.",
      )
      login_parser.set_defaults(func=CmdStudioLogin)
  
      STUDIO_LOGOUT_HELP = "Logout user from Studio"
      STUDIO_LOGOUT_DESCRIPTION = (
          "This removes the studio token from your global config.\n"
      )
  
      logout_parser = studio_subparser.add_parser(
          "logout",
          parents=[parent_parser],
          description=append_doc_link(
              STUDIO_LOGOUT_DESCRIPTION, "studio/logout"
          ),
          help=STUDIO_LOGOUT_HELP,
          formatter_class=formatter.RawDescriptionHelpFormatter,
      )
  
      logout_parser.set_defaults(func=CmdStudioLogout)
  
      STUDIO_TOKEN_HELP = "View the token dvc uses to contact Studio"  # noqa: S105 # nosec B105
  
      logout_parser = studio_subparser.add_parser(
          "token",
          parents=[parent_parser],
          description=append_doc_link(
              STUDIO_TOKEN_HELP, "studio/token"
          ),
          help=STUDIO_TOKEN_HELP,
          formatter_class=formatter.RawDescriptionHelpFormatter,
      )
  
      logout_parser.set_defaults(func=CmdStudioToken)
  
file_path: dvc/dvc/commands/studio.py
imports: import os
  from funcy import get_in
  from dvc.cli import formatter
  from dvc.cli.utils import append_doc_link
  from dvc.commands.config import CmdConfig
  from dvc.log import logger
label_desc: Use image node_id 1 for calling a global function with example usage: add_parser(subparsers, parent_parser) without return types