Add a link.

        Parameters
        ----------
        dataset : `dict` of ([`int`, `str`] or [`list` of `int`, `list` of `str`])
            Dataset.
        source : `iterable` of `str`
            Link source.
        target : `str`
            Link target.
        count : `int`, optional
            Link count (default: 1).

def add_link(dataset, source, target, count=1):
        """Add a link.

        Parameters
        ----------
        dataset : `dict` of ([`int`, `str`] or [`list` of `int`, `list` of `str`])
            Dataset.
        source : `iterable` of `str`
            Link source.
        target : `str`
            Link target.
        count : `int`, optional
            Link count (default: 1).
        """
        try:
            node = dataset[source]
            values, links = node
            if isinstance(links, list):
                try:
                    idx = links.index(target)
                    values[idx] += count
                except ValueError:
                    links.append(target)
                    values.append(count)
            elif links == target:
                node[0] += count
            else:
                node[0] = [values, count]
                node[1] = [links, target]
        except KeyError:
            dataset[source] = [count, target]