def _tokens_from_patsy(node):
    """
    Yields all the individual tokens from within a patsy formula
    as parsed by patsy.parse_formula.parse_formula.

    Parameters
    ----------
    node : patsy.parse_formula.ParseNode

    """
    for n in node.args:
        for t in _tokens_from_patsy(n):
            yield t

    if node.token:
        yield node.token
Yields all the individual tokens from within a patsy formula
    as parsed by patsy.parse_formula.parse_formula.

    Parameters
    ----------
    node : patsy.parse_formula.ParseNode