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: Serialize a SuiteResult instance into Junit format. This can then be output as a str or a XML object.
  
  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.
  encoding : str
      What format to encode the output str into.
  return_xml : bool
      Whether to return a str or a XML object
  **kwargs :
      all other key-value arguments will be passed to the CheckResult/CheckFailure
      serializers
  
  Returns
  -------
  Union[str, ET.Element]
docstr_tok: ["Serialize","a","SuiteResult","instance","into","Junit","format",".","This","can","then","be","output","as","a","str","or","a","XML","object",".","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",".","encoding",":","str","What","format","to","encode","the","output","str","into",".","return_xml",":","bool","Whether","to","return","a","str","or","a","XML","object","*","*","kwargs",":","all","other","key-value","arguments","will","be","passed","to","the","CheckResult\/CheckFailure","serializers","Returns","--","--","--","-","Union","[","str",",","ET.Element","]"]
code: def serialize(
      self,
      failure_tag: str = "failure",
      encoding: str = "utf-8",
      return_xml: bool = False,
      **kwargs,
  ) -> Union[str, ET.Element]:
      """Serialize a SuiteResult instance into Junit format. This can then be output as a str or a XML object.
  
      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.
      encoding : str
          What format to encode the output str into.
      return_xml : bool
          Whether to return a str or a XML object
      **kwargs :
          all other key-value arguments will be passed to the CheckResult/CheckFailure
          serializers
  
      Returns
      -------
      Union[str, ET.Element]
      """
      if failure_tag not in [FAILURE, SKIPPED]:
          raise ValueError(
              f"failure_tag must be one of {FAILURE} or {SKIPPED}"
          )
  
      results = self._serialize_test_cases(encoding, failure_tag)
  
      root = self._create_junit_test_suites_wrapper(
          failure_tag, results
      )
  
      root = self._process_test_suites(failure_tag, results, root)
  
      if return_xml:
          return root
  
      else:
          xml_str = _clean_illegal_xml_chars(
              ET.tostring(root, encoding=encoding).decode(encoding)
          )
          return xml_str
  
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 2 for calling the SuiteResultSerializer obj's underlying member method code with example usage: obj.serialize(failure_tag, encoding, return_xml) and returns: root, xml_str