def load_partition_meta(meta_file):
    """Load partition metadata and do sanity check.

    Parameters
    ----------
    meta_file : str
        The path of the partition metadata file.

    Returns
    -------
    PartitionMeta
        The partition metadata.
    """
    with open(meta_file) as f:
        try:
            part_meta = PartitionMeta(**(json.load(f)))
        except dt.ValidationError as e:
            raise DGLError(
                f"Invalid partition metadata JSON. Error details: {e.json()}"
            )
        if part_meta.version != "1.0.0":
            raise DGLError(
                f"Invalid version[{part_meta.version}]. Supported versions: '1.0.0'"
            )
        if part_meta.num_parts <= 0:
            raise DGLError(
                f"num_parts[{part_meta.num_parts}] should be greater than 0."
            )
        if part_meta.algo_name not in ["random", "metis"]:
            raise DGLError(
                f"algo_name[{part_meta.num_parts}] is not supported."
            )
        return part_meta
Load partition metadata and do sanity check.

    Parameters
    ----------
    meta_file : str
        The path of the partition metadata file.

    Returns
    -------
    PartitionMeta
        The partition metadata.
    
tools/partition_algo/base.py