def label_from_re(self, pat:str, full_path:bool=False, label_cls:Callable=None, **kwargs)->'LabelList':
        "Apply the re in `pat` to determine the label of every filename.  If `full_path`, search in the full name."
        pat = re.compile(pat)
        def _inner(o):
            s = str((os.path.join(self.path,o) if full_path else o).as_posix())
            res = pat.search(s)
            assert res,f'Failed to find "{pat}" in "{s}"'
            return res.group(1)
        return self.label_from_func(_inner, label_cls=label_cls, **kwargs)
def label_from_re ( self , pat : str , full_path : bool = False , label_cls : Callable = None , ** kwargs ) -> 'LabelList' : pat = re . compile ( pat ) def _inner ( o ) : s = str ( ( os . path . join ( self . path , o ) if full_path else o ) . as_posix ( ) ) res = pat . search ( s ) assert res , f'Failed to find "{pat}" in "{s}"' return res . group ( 1 ) return self . label_from_func ( _inner , label_cls = label_cls , ** kwargs )
Apply the re in `pat` to determine the label of every filename.  If `full_path`, search in the full name.