code: def fetch_metadata(
      user=None, user_args=None, user_script_config=None
  ):
      """Infer rest information about the process + versioning"""
      metadata = {"user": user if user else getpass.getuser()}
  
      metadata["orion_version"] = orion.core.__version__
  
      if user_args is None:
          user_args = []
  
      # Trailing white space are caught by argparse as an empty argument
      if len(user_args) == 1 and user_args[0] == "":
          user_args = []
  
      if user_script_config is None:
          user_script_config = (
              orion.core.config.worker.user_script_config
          )
  
      cmdline_parser = OrionCmdlineParser(user_script_config)
      cmdline_parser.parse(user_args)
  
      if cmdline_parser.user_script:
          # TODO: Remove this, it is all in cmdline_parser now
          metadata["user_script"] = cmdline_parser.user_script
          metadata["VCS"] = infer_versioning_metadata(
              cmdline_parser.user_script
          )
  
      if user_args:
          metadata["user_args"] = user_args
          metadata["parser"] = cmdline_parser.get_state_dict()
          metadata["user_script_config"] = user_script_config
          metadata["priors"] = dict(cmdline_parser.priors)
  
      return metadata
  
imports: import copy
  import getpass
  import hashlib
  import logging
  import os
  import git
  import yaml
  from numpy import inf
  import orion
  import orion.core
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.utils.flatten import unflatten
label_desc: Use image node_id 6 for calling a global function with example usage: fetch_metadata(user, user_args, user_script_config) and returns: metadata