code: def process_markdown(source, fout):
      def gen():
          for markdown_line in source:
              rst_lines = m2r.convert(markdown_line).split("\n")
              skip_flag = True
              for line in rst_lines:
                  if line == "" and skip_flag and False:
                      #
                      # Suppress empty lines at the start of each section, they
                      # are not needed.
                      #
                      continue
                  yield line
                  skip_flag = bool(line)
  
      for line in gen():
          fout.write("# %s\n" % line)
  
imports: import json
  import sys
  import m2r
label_desc: Use image node_id 2 for calling a global function with example usage: process_markdown(source, fout) without return types