code: def _hide_workspace(
      scm: Union["Git", "NoSCM"], res: Dict[str, Result]
  ) -> Dict[str, Result]:
      # Hide workspace params if they are the same as in the active branch
      try:
          active_branch = scm.active_branch()
      except (SCMError, NoSCMError):
          # SCMError - detached head
          # NoSCMError - no repo case
          pass
      else:
          if res.get("workspace") == res.get(active_branch):
              res.pop("workspace", None)
  
      return res
  
imports: import os
  from itertools import chain
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, Optional, Tuple, TypedDict, Union
  from funcy import ldistinct
  from scmrepo.exceptions import SCMError
  from dvc.log import logger
  from dvc.scm import NoSCMError
  from dvc.utils import as_posix, expand_paths
  from dvc.utils.collections import ensure_list
  from dvc.utils.serialize import load_path
label_desc: Use image node_id 9 for calling a global function with example usage: _hide_workspace(scm, res) and returns: res