def METHOD_NAME(self, task, config):
    if not config:
        return
    config = self.prepare_config(config)
    existing = config['existing']
    for entry in task.accepted:
        if 'location' not in entry:
            entry.fail('Does not have location field for symlinking')
            continue
        linkfrom = entry['location']
        linkfrom_path, linkfrom_name = os.path.split(linkfrom)
        # get the proper path and name in order of: entry, config, above split
        linkto_path = entry.get('link_to', config.get('to', linkfrom_path))
        if config.get('rename'):
            linkto_name = config['rename']
        elif entry.get('filename') and entry['filename'] != linkfrom_name:
            # entry specifies different filename than what was split from the path
            # since some inputs fill in filename it must be different in order to be used
            linkto_name = entry['filename']
        else:
            linkto_name = linkfrom_name
        try:
            linkto_path = entry.render(linkto_path)
        except RenderError as err:
            raise plugin.PluginError(
                f'Path value replacement `{linkto_path}` failed: {err.args[0]}'
            )
        try:
            linkto_name = entry.render(linkto_name)
        except RenderError as err:
            raise plugin.PluginError(
                f'Filename value replacement `{linkto_name}` failed: {err.args[0]}'
            )
        # Clean invalid characters with pathscrub plugin
        linkto_path = pathscrub(os.path.expanduser(linkto_path))
        linkto_name = pathscrub(linkto_name, filename=True)
        # Join path and filename
        linkto = os.path.join(linkto_path, linkto_name)
        if linkto == entry['location']:
            raise plugin.PluginWarning('source and destination are the same.')
        # Hardlinks for dirs will not be failed here
        if os.path.exists(linkto) and (
            config['link_type'] == 'soft' or os.path.isfile(linkfrom)
        ):
            msg = 'Symlink destination %s already exists' % linkto
            if existing == 'ignore':
                logger.verbose(msg)
            else:
                entry.fail(msg)
            continue
        logger.verbose('{}link `{}` to `{}`', config['link_type'], linkfrom, linkto)
        try:
            if config['link_type'] == 'soft':
                os.symlink(linkfrom, linkto)
            else:
                if os.path.isdir(linkfrom):
                    self.hard_link_dir(linkfrom, linkto, existing)
                else:
                    dirname = os.path.dirname(linkto)
                    if not os.path.exists(dirname):
                        os.makedirs(dirname)
                    os.link(linkfrom, linkto)
        except OSError as e:
            entry.fail('Failed to create {}link, {}'.format(config['link_type'], e))