def METHOD_NAME(self, datapath):
    folder, fold = os.path.split(datapath)
    with PathManager.open(os.path.join(folder, "tasks.txt")) as taskf:
        tasks_table = pd.read_json(taskf, lines=True)
    dfolder = os.path.join(folder, "dialogues")
    data = []
    for filename in PathManager.ls(dfolder):
        domain = filename.replace(".txt", "")
        if (
            self.opt["metalwoz_domains"]
            and domain not in self.opt["metalwoz_domains"]
        ):
            continue
        fullfn = os.path.join(dfolder, filename)
        with PathManager.open(fullfn) as dataf:
            lines = pd.read_json(dataf, lines=True)
            lines = lines.merge(tasks_table, on="task_id")
            data.append(lines.to_dict("records"))
    # Quick check to make sure we didn't fat-finger the spelling of some domain
    if self.opt["metalwoz_domains"]:
        assert len(data) == len(self.opt["metalwoz_domains"])
    if "test" in self.fold:
        flat = []
        for domain in data:
            flat.extend(domain)
        return flat
    return DatatypeHelper.split_subset_data_by_fold(self.fold, data, 0.8, 0.1, 0.1)