docs: def guess_depth(self, root_dir):
          """
          Try to guess the depth of a directory repository (i.e. whether it has
          sub-folders for multiple subjects or visits, depending on where files
          and/or derived label files are found in the hierarchy of
          sub-directories under the root dir.
  
          Parameters
          ----------
          root_dir : str
              Path to the root directory of the repository
          """
          deepest = -1
          for path, dirs, files in os.walk(root_dir):
              depth = self.path_depth(path)
              filtered_files = self._filter_files(files, path)
              if filtered_files:
                  logger.info("Guessing depth of directory repository at '{}' is"
                              " {} due to unfiltered files ('{}') in '{}'"
                              .format(root_dir, depth,
                                      "', '".join(filtered_files), path))
                  return depth
              if self.PROV_DIR in dirs:
                  depth_to_return = max(depth - 1, 0)
                  logger.info("Guessing depth of directory repository at '{}' is"
                              "{} due to \"Derived label file\" in '{}'"
                              .format(root_dir, depth_to_return, path))
                  return depth_to_return
              if depth >= self.MAX_DEPTH:
                  logger.info("Guessing depth of directory repository at '{}' is"
                              " {} as '{}' is already at maximum depth"
                              .format(root_dir, self.MAX_DEPTH, path))
                  return self.MAX_DEPTH
              try:
                  for fpath in chain(filtered_files,
                                     self._filter_dirs(dirs, path)):
                      Fileset.from_path(fpath)
              except ArcanaError:
                  pass
              else:
                  if depth > deepest:
                      deepest = depth
          if deepest == -1:
              raise ArcanaRepositoryError(
                  "Could not guess depth of '{}' repository as did not find "
                  "a valid session directory within sub-directories."
                  .format(root_dir))
          return deepest