code: def test_matches_mystnb():
      assert matches_mystnb("") is False
      assert matches_mystnb("```{code-cell}\n```") is False
      assert matches_mystnb("---\njupytext: true\n---") is False
      for ext in myst_extensions(no_md=True):
          assert matches_mystnb("", ext=ext) is True
      text = dedent(
          """\
          ---
          {{a
          ---
          ```{code-cell}
          :b: {{c
          ```
          """
      )
      assert matches_mystnb(text) is True
      text = dedent(
          """\
          ---
          jupytext:
              text_representation:
                  format_name: myst
                  extension: .md
          ---
          """
      )
      assert matches_mystnb(text) is True
      text = dedent(
          """\
          ---
          a: 1
          ---
          > ```{code-cell}
            ```
          """
      )
      assert matches_mystnb(text) is True
      assert guess_format(text, ".md") == ("myst", {})
  
imports: import json
  import unittest.mock
  from textwrap import dedent
  import pytest
  from nbformat.v4.nbbase import new_notebook
  from tornado.web import HTTPError
  import jupytext
  from jupytext.cli import jupytext
  from jupytext.compare import compare
  from jupytext.formats import JupytextFormatError, get_format_implementation, guess_format
  from jupytext.myst import CODE_DIRECTIVE, MystMetadataParsingError, matches_mystnb, myst_extensions, myst_to_notebook
label_desc: Use image node_id 5 for calling a global function with example usage: test_matches_mystnb() without return types