class_docstr: Serializes any SuiteResult instance into Junit format.
  
  Parameters
  ----------
  value : SuiteResult
      SuiteResult instance that needed to be serialized.
class_docstr_tok: ["Serializes","any","SuiteResult","instance","into","Junit","format",".","Parameters","--","--","--","--","--","value",":","SuiteResult","SuiteResult","instance","that","needed","to","be","serialized","."]
docstr: Organize the results into test suites and gather metadata about each one of the tests.
  
  Parameters
  ----------
  failure_tag : str
      Set the tests that fail as either skipped or failure, this allows CI/CD systems to ignore failed tests if
      development does not want them to stop the build.
  results : dict
      Organized and serialized test suites to be added to the root of the xml tree.
  root : ET.Element
      The root of the xml tree to append test suites and test cases too.
  
  Returns
  -------
  ET.Element
docstr_tok: ["Organize","the","results","into","test","suites","and","gather","metadata","about","each","one","of","the","tests",".","Parameters","--","--","--","--","--","failure_tag",":","str","Set","the","tests","that","fail","as","either","skipped","or","failure",",","this","allows","CI\/CD","systems","to","ignore","failed","tests","if","development","does","not","want","them","to","stop","the","build",".","results",":","dict","Organized","and","serialized","test","suites","to","be","added","to","the","root","of","the","xml","tree",".","root",":","ET.Element","The","root","of","the","xml","tree","to","append","test","suites","and","test","cases","too",".","Returns","--","--","--","-","ET.Element"]
code: def _process_test_suites(
      failure_tag: str, results: Dict, root: ET.Element
  ) -> ET.Element:
      """Organize the results into test suites and gather metadata about each one of the tests.
  
      Parameters
      ----------
      failure_tag : str
          Set the tests that fail as either skipped or failure, this allows CI/CD systems to ignore failed tests if
          development does not want them to stop the build.
      results : dict
          Organized and serialized test suites to be added to the root of the xml tree.
      root : ET.Element
          The root of the xml tree to append test suites and test cases too.
  
      Returns
      -------
      ET.Element
      """
      run_time = 0
  
      for this_suite in results.keys():
          attributes = {
              "name": this_suite,
              "errors": "0",
              "tests": str(len(results[this_suite])),
              "timestamp": datetime.now()
              .replace(microsecond=0)
              .isoformat(),
          }
  
          if failure_tag == f"{FAILURE}":
              attributes.update(
                  {
                      "failures": str(
                          sum(
                              list(results[this_suite][i])[0].tag
                              == FAILURE
                              for i in range(len(results[this_suite]))
                          )
                      )
                  }
              )
          elif failure_tag == f"{SKIPPED}":
              attributes.update(
                  {
                      "skipped": str(
                          sum(
                              list(results[this_suite][i])[0].tag
                              == SKIPPED
                              for i in range(len(results[this_suite]))
                          )
                      )
                  }
              )
              attributes.update({"failures": "0"})
  
          suite_time = sum(
              [
                  int(this_result.attrib["time"])
                  for this_result in results[this_suite]
              ]
          )
          run_time += suite_time
  
          attributes.update({"time": str(suite_time)})
  
          test_suite = ET.SubElement(
              root, "testsuite", attrib=attributes
          )
          test_suite.extend(results[this_suite])
  
      root.attrib["time"] = str(run_time)
  
      return root
  
file_path: deepchecks/deepchecks/core/serialization/suite_result/junit.py
imports: import re
  import sys
  import xml.etree.ElementTree
  from datetime import datetime
  from typing import Dict, List, Union
  from six import u
  from deepchecks.core import check_result
  from deepchecks.core import suite
  from deepchecks.core.serialization.abc import JunitSerializer
  from deepchecks.core.serialization.check_failure.junit import FAILURE, SKIPPED, CheckFailureSerializer
  from deepchecks.core.serialization.check_result.junit import CheckResultSerializer
label_desc: Use image node_id 3 for calling the SuiteResultSerializer obj's underlying member method code with example usage: obj._process_test_suites(failure_tag, results, root) and returns: root