code: def canonical_dir(
      path,
      diff_tool=None,
      local=False,
      diff_file_name=None,
      diff_tool_timeout=None,
  ):
      abs_path = os.path.abspath(path)
      assert os.path.exists(
          abs_path
      ), "Canonical path {} does not exist".format(path)
      assert os.path.isdir(
          abs_path
      ), "Path {} is not a directory".format(path)
      if diff_file_name and not diff_tool:
          raise Exception(
              "diff_file_name can be only be used with diff_tool for canonical_dir"
          )
      tempdir = tempfile.mkdtemp()
      safe_path = os.path.join(tempdir, os.path.basename(abs_path))
      shutil.copytree(abs_path, safe_path)
      return runtime._get_ya_plugin_instance().file(
          safe_path,
          diff_tool=diff_tool,
          local=local,
          diff_file_name=diff_file_name,
          diff_tool_timeout=diff_tool_timeout,
      )
  
file_path: catboost/library/python/testing/yatest_common/yatest/common/canonical.py
imports: import os
  import logging
  import shutil
  import tempfile
  import six
  from .None import process
  from .None import runtime
  from .None import path
label_desc: Use image node_id 3 for calling a global function with example usage: canonical_dir(path, diff_tool, local, diff_file_name, diff_tool_timeout) and returns: runtime