code: def label_from_folder(self, label_cls:Callable=None, **kwargs)->'LabelList':
          "Give a label to each filename depending on its folder."
          return self.label_from_func(func=lambda o: (o.parts if isinstance(o, Path) else o.split(os.path.sep))[-2],
                                      label_cls=label_cls, **kwargsf label_from_folder(self, label_cls:Callable=None, **kwargs)->'LabelList':
          "Give a label to each filename depending on its folder."
          return self.label_from_func(func=lambda o: (o.parts if isinstance(o, Path) else o.split(os.path.sep))[-2],
                                      label_cls=label_cls, **kwargs)
docs: Give a label to each filename depending on its folder.