code: def format_list(a_list, depth=0, width=4, templates=None):
      r"""Render a list on multiple lines
  
      Parameters
      ----------
      a_list: list
          The list 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 list of lists.
      templates: dict
          Templates for `list`, `item` and `list_node`.
          Default is
          `list="{tab}[\n{items}\n{tab}]"`
          `item="{tab}{item}\n"`
          `list_node="{item}\n"`
  
      Examples
      --------
      >>> print(format_list([1, [2, 3], 4, [5, 6, 7, 8]]))
      [
          1
          [
              2
              3
          ]
          4
          [
              5
              6
              7
              8
          ]
      ]
      >>> templates = {}
      >>> templates['list'] = '{tab}\n{items}\n{tab}'
      >>> templates['item'] = '{tab}- {item}\n'
      >>> templates['list_node'] = '{tab}{item}\n'
      >>> print(format_list([1, [2, 3], 4, [5, 6, 7, 8]], width=2, templates=templates))
        - 1
  
          - 2
          - 3
  
        - 4
  
          - 5
          - 6
          - 7
          - 8
  
      """
      # To avoid using mutable objects as default values in function signature.
      if templates is None:
          templates = {}
  
      list_template = templates.get("list", LIST_TEMPLATE)
      item_template = templates.get("item", LIST_ITEM_TEMPLATE)
      node_template = templates.get("list_node", LIST_NODE_TEMPLATE)
  
      tab = " " * (depth * width)
      list_string = ""
      for i, item in enumerate(a_list, 1):
          subtab = " " * ((depth + 1) * width)
          if isinstance(item, (dict, list, tuple)):
              item_string = format_dict(
                  item, depth + 1, width=width, templates=templates
              )
              list_string += node_template.format(
                  tab=subtab, id=i, item=item_string
              )
          else:
              list_string += item_template.format(
                  tab=subtab, id=i, item=item
              )
  
      return list_template.format(
          tab=tab, items=list_string.rstrip("\n")
      )
  
file_path: orion/src/orion/core/utils/format_terminal.py
label_desc: Use image node_id 4 for calling a global function with example usage: format_list(a_list, depth, width, templates) and returns: list_template