def get_max_order(basis, refname):
    """Get the maximum order of a basis."""
    if refname in ["interval", "triangle", "tetrahedron"]:
        return max(sum(i.indices) for i in basis)
    if refname in ["quadrilateral", "hexahedron"]:
        return max(max(i.indices) for i in basis)
    if refname == "prism":
        return max(max(sum(i.indices[:2]), i.indices[2]) for i in basis)