def METHOD_NAME(self, triangulation):
    if triangulation is None:
        return None
    if len(triangulation["triangles"]) != len(triangulation["type_ids"]):
        raise ValueError(
            "Number of type_ids do not match number of triangles.")
    return triangulation