def check_all_same_schema(schemas, name):
    """Check the list of schemas are the same."""
    if len(schemas) == 0:
        return

    for i, schema in enumerate(schemas):
        if schema != schemas[0]:
            raise DGLError(
                "Expect all graphs to have the same schema on {}, "
                "but graph {} got\n\t{}\nwhich is different from\n\t{}.".format(
                    name, i, schema, schemas[0]
                )
            )
Check the list of schemas are the same.
python/dgl/utils/checks.py