code: def _format_file(path, root):
      typeDesc, icon, iconTooltip, viewer = _file_type_info(path)
      opDesc, opRun = _op_source_info(path)
      relpath = path[len(root) + 1 :]
      mtime = util.safe_mtime(path)
      if mtime:
          mtime = int(mtime * 1000)
      return {
          "path": relpath,
          "size": util.safe_filesize(path),
          "mtime": mtime,
          "type": typeDesc,
          "icon": icon,
          "iconTooltip": iconTooltip,
          "viewer": viewer,
          "operation": opDesc,
          "run": opRun,
      }
  
imports: import json
  import logging
  import os
  import re
  import socket
  import sys
  import guild
  import guild.run
  from guild import batch_util
  from guild import cli
  from guild import click_util
  from guild import config
  from guild import index
  from guild import run_util
  from guild import util
  from guild import var
  from guild import view
  from .None import compare_impl
  from .None import runs_impl
label_desc: Use image node_id 13 for calling a global function with example usage: _format_file(path, root) and returns: dict