code: def relative_symlink(source_path, link_path):
    
    if not os.path.isabs(source_path):
      raise ValueError("Path for source:{} must be absolute".format(source_path))
    if not os.path.isabs(link_path):
      raise ValueError("Path for link:{} must be absolute".format(link_path))
    if source_path == link_path:
      raise ValueError("Path for link is identical to source:{}".format(source_path))
    # The failure state below had a long life as an uncaught error. No behavior was changed here, it just adds a catch.
    # Raising an exception does differ from absolute_symlink, which takes the liberty of deleting existing directories.
    if os.path.isdir(link_path) and not os.path.islink(link_path):
      raise ValueError("Path for link would overwrite an existing directory: {}".format(link_path))
    try:
      if os.path.lexists(link_path):
        os.unlink(link_path)
      rel_path = os.path.relpath(source_path, os.path.dirname(link_path))
      safe_mkdir_for(link_path)
      os.symlink(rel_path, link_path)
    except OSError as e:
      # Another run may beat us to deletion or creation.
      if not (e.errno == errno.EEXIST or e.errno == errno.ENOENT):
        raise
docs: Create a symlink at link_path pointing to relative source
  
    :param source_path: Absolute path to source file
    :param link_path: Absolute path to intended symlink
    :raises ValueError if source_path or link_path are not unique, absolute paths
    :raises OSError on failure UNLESS file already exists or no such file/directory