code: def format_dict(dictionary, depth=0, width=4, templates=None):
      r"""Render a dict on multiple lines
  
      Parameters
      ----------
      dictionary: dict
          The dictionary to render
      depth: int
          Tab added at the beginning of every lines
      width: int
          Size of the tab added to each line, multiplied
          by the depth of the object in the dict of dicts.
      templates: dict
          Templates for `empty_leaf`, `leaf` and `dict_node`.
          Default is
          `empty_leaf="{tab}{key}"`
          `leaf="{tab}{key}: {value}\n"`
          `dict_node="{tab}{key}:\n{value}\n"`
  
      Examples
      --------
      >>> print(format_dict({1: {2: 3, 3: 4}, 2: {3: 4, 4: {5: 6}}}))
      1:
          2: 3
          3: 4
      2:
          3: 4
          4:
              5: 6
      >>> templates = {'leaf': '{tab}{key}={value}\n', 'dict_node': '{tab}{key}:\n{value}\n'}
      >>> print(format_dict({1: {2: 3, 3: 4}, 2: {3: 4, 4: {5: 6}}}, templates=templates))
      1:
          2=3
          3=4
      2:
          3=4
          4:
              5=6
  
      """
      if isinstance(dictionary, (list, tuple)):
          return format_list(
              dictionary, depth, width=width, templates=templates
          )
  
      # To avoid using mutable objects as default values in function signature.
      if templates is None:
          templates = {}
  
      empty_leaf_template = templates.get(
          "empty_leaf", DICT_EMPTY_LEAF_TEMPLATE
      )
      leaf_template = templates.get("leaf", DICT_LEAF_TEMPLATE)
      node_template = templates.get("dict_node", DICT_NODE_TEMPLATE)
  
      dict_string = ""
      for key in sorted(dictionary.keys()):
          tab = " " * (depth * width)
          value = dictionary[key]
          if isinstance(value, (dict, list, tuple)):
              if not value:
                  dict_string += empty_leaf_template.format(
                      tab=tab, key=key
                  )
              else:
                  subdict_string = format_dict(
                      value, depth + 1, width=width, templates=templates
                  )
                  dict_string += node_template.format(
                      tab=tab, key=key, value=subdict_string
                  )
          else:
              dict_string += leaf_template.format(
                  tab=tab, key=key, value=value
              )
  
      return dict_string.replace(" \n", "\n").rstrip("\n")
  
file_path: orion/src/orion/core/utils/format_terminal.py
label_desc: Use image node_id 3 for calling a global function with example usage: format_dict(dictionary, depth, width, templates) and returns: dict_string, format_list