code: def md_to_text(md, do_md_to_text=True):
      if not do_md_to_text:
          return md
      assert md is not None, "Markdown is None"
      html = markdown.markdown(md)
      soup = BeautifulSoup(html, features="html.parser")
      return soup.get_text()
  
imports: import ast
  import time
  import os
  import markdown
  import pytest
  from bs4 import BeautifulSoup
  from src.utils import is_gradio_version4
  from tests.utils import get_inf_server
label_desc: Use image node_id 19 for calling a global function with example usage: md_to_text(md, do_md_to_text) and returns: soup, md