docs: def get_mod_paths(mod_name, out_dir):
      """Get source and stub paths for a module."""
      paths = []
      try:
          mod = get_loader(mod_name)
          source = Path(mod.path)
          if source.name.endswith(".py"):
              source_rel = Path(*mod_name.split("."))
              if source.name == "__init__.py":
                  source_rel = source_rel.joinpath("__init__.py")
              destination = Path(out_dir, source_rel.with_suffix(".pyi"))
              paths.append((source, destination))
      except Exception as e:
          _logger.debug(e)
          _logger.warning("cannot handle module, skipping: %s", mod_name)
      return paths