code: def _init_resource_cache(guild_dir, local):
      env_cache = os.path.join(guild_dir, "cache", "resources")
      if os.path.exists(env_cache):
          log.info("Resource cache %s exists, skipping", env_cache)
          return
      if local:
          if os.path.islink(env_cache):
              os.unlink(env_cache)
          util.ensure_dir(env_cache)
      else:
          shared_cache = _shared_resource_cache(guild_dir)
          util.ensure_dir(shared_cache)
          os.symlink(shared_cache, env_cache)
  
imports: import errno
  import logging
  import os
  from guild import guildfile
  from guild import util
label_desc: Use image node_id 5 for calling a global function with example usage: _init_resource_cache(guild_dir, local) without return types