def _get_perf_hint(hint, index: int, _default=None):
    """
    Extracts a "performance hint" value -- specified as either a scalar or 2-tuple -- for
    either the left or right Dataset in a merge.

    Parameters
    ----------
    hint : scalar or 2-tuple of scalars, optional
    index : int
        Indicates whether the hint value is being extracted for the left or right Dataset.
        0 = left, 1 = right.
    _default : optional
        Optional default value, returned if `hint` is None.

    Returns
    -------
    Any
        The extracted performance hint value.
    """
    if hint is None:
        return _default
    elif isinstance(hint, tuple):
        return hint[index]
    else:
        return hint