code: def find_jupytext_configuration_file(path, search_parent_dirs=True):
      """Return the first jupytext configuration file in the current directory, or any parent directory"""
      if os.path.isdir(path):
          for filename in JUPYTEXT_CONFIG_FILES:
              full_path = os.path.join(path, filename)
              if os.path.isfile(full_path):
                  return full_path
  
      pyproject_path = os.path.join(path, PYPROJECT_FILE)
      if os.path.isfile(pyproject_path):
          import toml
  
          with open(pyproject_path) as stream:
              doc = toml.loads(stream.read())
              if doc.get("tool", {}).get("jupytext") is not None:
                  return pyproject_path
  
      if not search_parent_dirs:
          return None
  
      if JUPYTEXT_CEILING_DIRECTORIES and os.path.isdir(path):
          for ceiling_dir in JUPYTEXT_CEILING_DIRECTORIES:
              if os.path.isdir(ceiling_dir) and os.path.samefile(
                  path, ceiling_dir
              ):
                  return None
  
      parent_dir = os.path.dirname(path)
      if parent_dir == path:
          return find_global_jupytext_configuration_file()
  
      return find_jupytext_configuration_file(parent_dir)
  
imports: import json
  import os
  import warnings
  import yaml
  from traitlets import Bool, Dict, Enum, Float, List, Unicode, Union
  from traitlets.config import Configurable
  from traitlets.config.loader import PyFileConfigLoader
  from traitlets.traitlets import TraitError
  from .formats import NOTEBOOK_EXTENSIONS, long_form_multiple_formats, long_form_one_format, short_form_multiple_formats
label_desc: Use image node_id 4 for calling a global function with example usage: find_jupytext_configuration_file(path, search_parent_dirs) and returns: find_jupytext_configuration_file, None, find_global_jupytext_configuration_file, full_path, pyproject_path, None