class_docstr: parse documentation in comments
class_docstr_tok: ["parse","documentation","in","comments"]
code: def parse(self, elem, ctxt):
      # delete comments, after which there is code in one line
      line = (
          re.sub(r"\/\*(.*?)\*\/", "", elem)
          if re.match(r".*\*/(.+)", elem)
          else elem
      )
  
      assert not re.match(
          r".*\*/(.+)", line
      ), "Found the code after closed comment in the same line"
  
      # delete '%', it marks non-key words in oneDAL Doxygen documentation
      line = line.replace("%", "")
  
      # delete keys for formulas in oneDAL Doxygen documentation
      line = line.replace("\\f$", "")
  
      # delete internal references in oneDAL Doxygen documentation
      line = re.sub(r",?\s+\\ref[^(*/)]*", "", line)
  
      # delete oneDAL C++ substrings
      line = re.sub(r",?\s*\w+::[:\w]+", "", line)
  
      # try to find the beginning of algorithm template description
      regex = r"^ \* <a name=\"DAAL-CLASS-ALGORITHMS__.*(BATCH|ALGORITHMIMPL)\"></a>$"
      m = re.match(regex, line)
      if m:
          ctxt.doc_state = doc_state.template
          ctxt.doc = defaultdict()
          return True
  
      # if parsing of algorithm template description is in progress
      if ctxt.doc_state is doc_state.template:
          # try to find template param description
          m = re.match(r"^\s+\*\s+\\tparam\s+(\w+)\s+(.+)$", line)
          if m:
              ctxt.doc[m.group(1)] = m.group(2)
          # try to find end of algorithm template description
          m = re.match(r".*\*/", line)
          if m:
              ctxt.doc_state = doc_state.none
          return True
  
      # if it is still template then go to next line
      if ctxt.doc_state is doc_state.template:
          return True
  
      # clear the doc, if we will not find doc then we save empty line
      if ctxt.doc_state in [doc_state.single, doc_state.multi]:
          ctxt.doc = ""
  
      # try to find single line comment with documentation
      m = re.match(r"^.*/\*!<(.*?)\*/.*$", line)
      if m:
          # save the doc to context and continue with next parser
          ctxt.doc = m.group(1)
          ctxt.doc_state = doc_state.single
          return False
  
      # if it is multiline comment and there is place to insert it
      if ctxt.doc_state is doc_state.multi and ctxt.doc_lambda:
          doc = ctxt.doc_lambda()
          # try to find the end of comment with documentation
          m = re.match(r"^\s*(.+?)\*/", line)
          if m:
              ctxt.doc_state = doc_state.none
              ctxt.doc_lambda = None
          else:
              # take the text in the line
              m = re.match(r"^\s*(.+?)$", line)
          # append found comment to documentation
          doc[1] += " " + m.group(1)
          return True
  
      # try to find the begin of comment with documentation
      m = re.match(r"^.*/\*!<(.+?)$", line)
      if m:
          # save the begin of doc to context and continue with next parser
          ctxt.doc = m.group(1)
          ctxt.doc_state = doc_state.multi
          return False
  
      return False
  
imports: import re
  from collections import OrderedDict, defaultdict
label_desc: Use image node_id 1 for calling the comment_parser obj's underlying member method code with example usage: obj.parse(elem, ctxt) and returns: False, True, True, True, False, True, False