def get_tax_branch(taxid, tax_tree):
    """
    Return a list of all parents of a given taxid.

    The list begins with the taxid and ends with the root of the tree.
    """
    branch = []
    while taxid != 0:
        branch.append(taxid)
        # Gets the parent of current tax id
        taxid = tax_tree[taxid]
    return branch