code: def link_resources(origin, link_name, force, resources_path):
      from pathlib import Path
      from snips_nlu.cli.compatibility import create_symlink
      from snips_nlu.common.utils import get_package_path, is_package
      from snips_nlu.constants import DATA_PATH
      from snips_nlu.resources import get_resources_sub_directory
  
      if is_package(origin):
          resources_path = get_package_path(origin)
      else:
          resources_path = (
              Path(origin)
              if resources_path is None
              else Path(resources_path)
          )
      if not resources_path.exists():
          raise OSError("%s not found" % str(resources_path))
      link_path = DATA_PATH / str(link_name)
      if link_path.is_symlink() and not force:
          raise OSError("Symlink already exists: %s" % str(link_path))
      elif link_path.is_symlink():
          link_path.unlink()
      elif link_path.exists():
          raise OSError(
              "Symlink cannot be overwritten: %s" % str(link_path)
          )
      resources_sub_dir = get_resources_sub_directory(resources_path)
      create_symlink(link_path, resources_sub_dir)
      return link_path, resources_sub_dir
  
imports: from __future__ import print_function, unicode_literals
label_desc: Use image node_id 4 for calling a global function with example usage: link_resources(origin, link_name, force, resources_path) and returns: link_path,  resources_sub_dir