code: def _write_markdown(
      results: dict[
          str,
          list[
              tuple[
                  str,
                  str,
              ]
          ],
      ]
  ) -> None:
      """Writes all results to Markdown file."""
      table_lines = []
      converters = _CONVERTERS.value
  
      table_lines.append(
          "| Example | " + " ".join([f"{c} |" for c in converters])
      )
      table_lines.append("|" + (" --- |" * (len(converters) + 1)))
  
      error_lines = []
  
      def _header2anchor(header):
          header = header.lower().replace(" ", "-")
          header = "#" + re.sub(r"[^a-zA-Z0-9_-]+", "", header)
          return header
  
      for example_name, converter_results in results.items():
          # Make sure the converters are in the right order.
          assert [c[0] for c in converter_results] == converters
          line = f"| `{example_name}` |"
          example_error_lines = []
          for converter_name, error_msg in converter_results:
              if not error_msg:
                  line += " YES |"
              else:
                  error_header = (
                      f"Example: `{example_name}` | "
                      f"Converter: `{converter_name}`"
                  )
                  example_error_lines.append("### " + error_header)
                  example_error_lines.append(f"```\n{error_msg}\n```")
                  example_error_lines.append(
                      "[Back to top](#summary-table)\n"
                  )
                  line += f" [NO]({_header2anchor(error_header)}) |"
          table_lines.append(line)
  
          if example_error_lines:
              error_lines.append(f"## `{example_name}`")
              error_lines.extend(example_error_lines)
  
      g3doc_path = "../g3doc"
      output_path = os.path.join(
          g3doc_path, "convert_models_results.md"
      )
      template_path = output_path + ".template"
  
      if (workdir := "BUILD_WORKING_DIRECTORY") in os.environ:
          os.chdir(os.path.dirname(os.environ[workdir]))
  
      with tf.io.gfile.GFile(
          template_path, "r"
      ) as f_in, tf.io.gfile.GFile(output_path, "w") as f_out:
          template = "".join(f_in.readlines())
          template = template.replace(
              "{{generation_date}}", str(datetime.date.today())
          )
          template = template.replace(
              "{{table}}", "\n".join(table_lines)
          )
          template = template.replace(
              "{{errors}}", "\n".join(error_lines)
          )
  
          f_out.write(template)
  
      print("Written converter results to", output_path)
  
file_path: jax/jax/experimental/jax2tf/tests/models_test_main.py
imports: from collections.abc import Sequence
  import datetime
  import functools
  import numpy
  import os
  import re
  import jax
  from absl import app
  from absl import flags
  from jax._src import dtypes
  import tensorflow
  from jax.core import InconclusiveDimensionOperation
  from jax.experimental.jax2tf.tests.model_harness import ALL_HARNESSES
  from jax.experimental.jax2tf.tests.converters import ALL_CONVERTERS
label_desc: Use image node_id 1 for calling a global function with example usage: _write_markdown(results) and returns: header