def parse_graph(graph_file):
    """ Parse a Morphologist graph file to get the fold labels.

    Parameters
    ----------
    graph_file: str (mandatory)
        the path to a morphologist '.arg' graph file.

    Returns
    -------
    labels: dict
        a mapping between a mesh id and its label.
    """
    with open(graph_file) as open_file:
        lines = open_file.readlines()
    infold = False
    meshid = None
    label = None
    labels = {}
    for line in lines:
        if line.startswith('*BEGIN NODE fold'):
            infold = True
            continue
        if infold and line.startswith('*END'):
            if meshid in labels:
                raise ValueError("'{0}' mesh id already found.".format(meshid))
            labels[meshid] = label
            infold = False
            continue
        if infold and line.startswith('label'):
            label = line.replace('label', '').strip()
        if infold and line.startswith('Tmtktri_label'):
            meshid = int(line.replace('Tmtktri_label', '').strip())
    return labels
