code: def find_base_path_and_format(main_path, formats):
      """Return the base path and the format corresponding to the given path"""
      for fmt in formats:
          try:
              return base_path(main_path, fmt), fmt
          except InconsistentPath:
              continue
  
      raise InconsistentPath(
          "Path '{}' matches none of the export formats. "
          "Please make sure that jupytext.formats covers the current file "
          "(e.g. add '{}' to the export formats)".format(
              main_path, os.path.splitext(main_path)[1][1:]
          )
      )
  
file_path: jupytext/src/jupytext/paired_paths.py
imports: import os
  from .config import find_jupytext_configuration_file
  from .formats import NOTEBOOK_EXTENSIONS, long_form_multiple_formats, long_form_one_format, short_form_multiple_formats, short_form_one_format
label_desc: Use image node_id 6 for calling a global function with example usage: find_base_path_and_format(main_path, formats) and returns: base_path,  fmt