def METHOD_NAME(name, path):
    """
    .. versionadded:: 0.17.0
    Sets alternative for <name> to <path>, if <path> is defined
    as an alternative for <name>.
    name
        is the master name for this link group
        (e.g. pager)
    path
        is the location of one of the alternative target files.
        (e.g. /usr/bin/less)
    .. code-block:: yaml
        foo:
          alternatives.set:
            - path: /usr/bin/foo-2.0
    """
    ret = {"name": name, "path": path, "result": True, "changes": {}, "comment": ""}
    current = __salt__["alternatives.show_current"](name)
    if current == path:
        ret["comment"] = "Alternative for {} already set to {}".format(name, path)
        return ret
    display = __salt__["alternatives.display"](name)
    isinstalled = False
    for line in display.splitlines():
        if line.startswith(path):
            isinstalled = True
            break
    if isinstalled:
        if __opts__["test"]:
            ret["comment"] = "Alternative for {} will be set to path {}".format(
                name, path
            )
            ret["result"] = None
            return ret
        __salt__["alternatives.set"](name, path)
        current = __salt__["alternatives.show_current"](name)
        if current == path:
            ret["comment"] = "Alternative for {} set to path {}".format(name, current)
            ret["changes"] = {"path": current}
        else:
            ret["comment"] = "Alternative for {} not updated".format(name)
        return ret
    else:
        ret["result"] = False
        ret["comment"] = "Alternative {} for {} doesn't exist".format(path, name)
    return ret