def get_parents(red):
    """Yield the parents of the given red node

    :param red: the red baron source
    :type red: :class:`redbaron.base_nodes.Node` | :class:`redbaron.RedBaron`
    :returns: each parent of the given node
    :rtype: Generator[:class:`redbaron.base_nodes.Node`]
    :raises: None
    """
    current = red.parent
    while current:
        yield current
        current = current.parent
