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: Iterate over the test cases and serialize them into test suites.
  
  Parameters
  ----------
  encoding : str
      What format to encode the output str into.
  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.
  
  Returns
  -------
  Dict[str, List[ET.Element]]
docstr_tok: ["Iterate","over","the","test","cases","and","serialize","them","into","test","suites",".","Parameters","--","--","--","--","--","encoding",":","str","What","format","to","encode","the","output","str","into",".","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",".","Returns","--","--","--","-","Dict","[","str",",","List","[","ET.Element","]","]"]
code: def _serialize_test_cases(
      self, encoding, failure_tag
  ) -> Dict[str, List[ET.Element]]:
      """Iterate over the test cases and serialize them into test suites.
  
      Parameters
      ----------
      encoding : str
          What format to encode the output str into.
      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.
  
      Returns
      -------
      Dict[str, List[ET.Element]]
      """
      results = {}
  
      for it in self.value.results:
          if isinstance(it, check_types.CheckResult):
              result = CheckResultSerializer(it).serialize(
                  encoding=encoding
              )
          elif isinstance(it, check_types.CheckFailure):
              result = CheckFailureSerializer(it).serialize(
                  encoding=encoding, failure_tag=failure_tag
              )
          else:
              raise TypeError(f"Unknown result type - {type(it)}")
  
          if "checks" in result.attrib["classname"].split("."):
              test_suite_name = result.attrib["classname"].split(".")[
                  result.attrib["classname"].split(".").index("checks")
                  + 1
              ]
          else:
              test_suite_name = "checks"
  
          if test_suite_name not in results:
              results[test_suite_name] = [result]
          else:
              results[test_suite_name].append(result)
  
      return results
  
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 5 for calling the SuiteResultSerializer obj's underlying member method code with example usage: obj._serialize_test_cases(encoding, failure_tag) and returns: results