<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resize(self, targ_sz, new_path='tmp', resume=True, fn=None):
 """ Resizes all the images in the train, valid, test folders to a given size. Arguments: targ_sz (int):
 the target size new_path (str):
 the path to save the resized images (default tmp) resume (bool):
 if True, check for images in the DataSet that haven't been resized yet (useful if a previous resize operation was aborted) fn (function):
 optional custom resizing function """

        new_ds = []
        dls = [self.trn_dl,self.val_dl,self.fix_dl,self.aug_dl]
        if self.test_dl: dls += [self.test_dl, self.test_aug_dl]
        else: dls += [None,None]
        t = tqdm_notebook(dls)
        for dl in t: new_ds.append(self.resized(dl, targ_sz, new_path, resume, fn))
        t.close()
        return self.__class__(new_ds[0].path, new_ds, self.bs, self.num_workers, self.classes)