docs: def split_extension(path):
      """
      A extension splitter that checks for compound extensions such as
      'file.nii.gz'
  
      Parameters
      ----------
      filename : str
          A filename to split into base and extension
  
      Returns
      -------
      base : str
          The base part of the string, i.e. 'file' of 'file.nii.gz'
      ext : str
          The extension part of the string, i.e. 'nii.gz' of 'file.nii.gz'
      """
      for double_ext in double_exts:
          if path.endswith(double_ext):
              return path[:-len(double_ext)], double_ext
      dirname = os.path.dirname(path)
      filename = os.path.basename(path)
      parts = filename.split('.')
      if len(parts) == 1:
          base = filename
          ext = None
      else:
          ext = '.' + parts[-1]
          base = '.'.join(parts[:-1])
      return os.path.join(dirname, base), ext