code: def prettify(elem, level=0):
      i = "\n" + level * "  "
      if len(elem):
          if not elem.text or not elem.text.strip():
              elem.text = i + "  "
          for e in elem:
              prettify(e, level + 1)
          if not e.tail or not e.tail.strip():
              e.tail = i
      if level and (not elem.tail or not elem.tail.strip()):
          elem.tail = i
      return elem
  
file_path: imodels/imodels/tree/c45_tree/c45_utils.py
imports: import math
label_desc: Use image node_id 1 for calling a global function with example usage: prettify(elem, level) and returns: elem