class_docstr: Parser object handling the upper-level parsing of Oríon's arguments.
docstr: Call argparse and generate a dictionary of arguments' value
docstr_tok: ["Call","argparse","and","generate","a","dictionary","of","arguments","'","value"]
code: def parse(self, argv):
      """Call argparse and generate a dictionary of arguments' value"""
      args = vars(self.parser.parse_args(argv))
  
      verbose = args.pop("verbose", 0)
      levels = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
  
      logdir = args.pop("logdir")
      logfile = None
      if logdir is not None:
          os.makedirs(logdir, exist_ok=True)
  
          pid = os.getpid()
          logfile = os.path.join(logdir, f"orion_{pid}.log")
  
      logging.basicConfig(
          format="%(asctime)-15s::%(levelname)s::%(name)s::%(message)s",
          level=levels.get(verbose, logging.DEBUG),
          filename=logfile,
      )
      logger.debug("Orion version : %s", orion.core.__version__)
  
      if args["command"] is None:
          self.parser.parse_args(["--help"])
  
      function = args.pop("func", None)
      empty_command = (argv[-1] if argv else sys.argv[-1]) == args[
          "command"
      ]
      if function is None or (
          empty_command and args.pop("help_empty", False)
      ):
          self.parser.parse_args([args["command"], "--help"])
  
      return args, function
  
file_path: orion/src/orion/core/cli/base.py
imports: import argparse
  import logging
  import os
  import sys
  import textwrap
  import orion
  import orion.core
  from orion.core.io.database import DatabaseError
  from orion.core.utils.exceptions import BranchingEvent, InexecutableUserScript, MissingResultFile, NoConfigurationError, NoNameError
label_desc: Use image node_id 3 for calling the OrionArgsParser obj's underlying member method code with example usage: obj.parse(argv) and returns: args,  function