code: def _link_guild_dir(src, link):
      if os.path.lexists(link):
          link_target = os.path.realpath(link)
          if not util.compare_paths(src, link_target):
              log.warning(
                  "Guild directory %s exists (links to %s), "
                  "skipping link to Guild home %s",
                  link,
                  link_target,
                  src,
              )
          return
      if os.path.exists(link):
          log.warning(
              "Guild directory %s exists, skipping link to Guild home %s",
              link,
              src,
          )
          return
      util.ensure_dir(os.path.dirname(link))
      util.symlink(src, link)
  
imports: import errno
  import logging
  import os
  from guild import guildfile
  from guild import util
label_desc: Use image node_id 3 for calling a global function with example usage: _link_guild_dir(src, link) without return types