code: def _basename(fname):
      
      if not isinstance(fname, Path):
          fname = Path(fname)
      path, name, ext = fname.parent, fname.stem, fname.suffix
      return path, name, ext
docs: Return file name without path.