code: def get_terminal_map():
      """Get a map of device-id -> path as a dict.
      Used by Process.terminal()
      """
      ret = {}
      ls = glob.glob("/dev/tty*") + glob.glob("/dev/pts/*")
      for name in ls:
          assert name not in ret, name
          try:
              ret[os.stat(name).st_rdev] = name
          except FileNotFoundError:
              pass
      return ret
  
file_path: catboost/contrib/python/psutil/py3/psutil/_psposix.py
imports: import glob
  import os
  import signal
  import sys
  import time
  from ._common import memoize
  from ._common import sdiskusage
  from ._common import TimeoutExpired
  from ._common import usage_percent
  from ._compat import ChildProcessError
  from ._compat import FileNotFoundError
  from ._compat import InterruptedError
  from ._compat import PermissionError
  from ._compat import ProcessLookupError
  from ._compat import PY3
  from ._compat import unicode
label_desc: Use image node_id 4 for calling a global function with example usage: get_terminal_map() and returns: ret