code: def test_downgrade_heading():
      v3h = v3.new_heading_cell
      v4m = v4.new_markdown_cell
      v3m = lambda source: v3.new_text_cell("markdown", source)
      for v4cell, expected in [
          (
              v4m(source="# foo"),
              v3h(source="foo", level=1),
          ),
          (
              v4m(source="#foo"),
              v3h(source="foo", level=1),
          ),
          (
              v4m(source="#\tfoo"),
              v3h(source="foo", level=1),
          ),
          (
              v4m(source="# \t  foo"),
              v3h(source="foo", level=1),
          ),
          (
              v4m(source="# foo\nbar"),
              v3m(source="# foo\nbar"),
          ),
      ]:
          downgraded = convert.downgrade_cell(v4cell)
          assert downgraded == expected
  
file_path: nbformat/tests/v4/test_convert.py
imports: from __future__ import annotations
  import copy
  import os
  from unittest import mock
  import pytest
  from nbformat import ValidationError, v3, v4, validate
  from nbformat.v4 import convert
  from nbformat.v4.nbjson import reads
  from ..v3 import nbexamples
  from .None import nbexamples
label_desc: Use image node_id 4 for calling a global function with example usage: test_downgrade_heading() without return types