from typing import Optional


def extract_lineage_from_line(line: str, exclude_withdrawn=True) -> Optional[str]:
    """
    Extracts the lineage name from one of the lineage_notes.txt lines.

    Most lines look like this
        Q.3	Alias of B.1.1.7.3, USA lineage, from pango-designation issue #92
        (note, that's a tab character after `Q.3`)
    Some lineages are "Withdrawn". This is denoted by a `*` at lineage start
        *B.1.1.156	Withdrawn: South African lineage
        (note, that's a tab character after `*B.1.1.156`)

    In general, from talking with Alli Black, it appears that we should be fine
    to only ever care about non-withdrawn lineages. Similarly, we can ignore
    any "alias" names mentioned (eg, `B.1.1.7.3` above), the alias name is more
    of an academic understanding, not something used for identification.

    Returns:
        str OR None: Lineage for the line OR None if line should be ignored
    """
    lineage_chunk = line.split()[0]
    if exclude_withdrawn and lineage_chunk[0] == "*":
        return None
    return lineage_chunk