def ref(path, id_):
    """
    A "ref" is either a path or file ID. Here, given an argument for both,
    where only one is really present, return the ref.
    """
    assert (path is not None) ^ (id_ is not None)
    if path is not None and not path.startswith('/'):
        raise ValueError('Path must be absolute.')
    return path if path is not None else str(id_)
