code: def merge_markdown(nb: nbf.notebooknode.NotebookNode) -> None:
      """Merges consequent markdown cells into one."""
      start_idx = None
      slices = []
      for i, cell in enumerate(nb["cells"]):
          if cell["cell_type"] == "markdown":
              if start_idx is None:
                  start_idx = i
          else:
              if start_idx is not None:
                  if i - start_idx > 1:
                      slices.append(slice(start_idx, i))
                  start_idx = None
      for sl in slices[::-1]:
          nb["cells"][sl.start]["source"] = "\n\n".join(
              [c["source"].rstrip() for c in nb["cells"][sl]]
          )
          del nb["cells"][sl.start + 1 : sl.stop]
  
imports: import argparse
  import logging
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: merge_markdown(nb) without return types