code: def _build_string(node: Node) -> str:
      """Builds a formatted string for displaying the nodes.
  
      References:
          https://github.com/joowani/binarytree/blob/master/binarytree/__init__.py#L153
  
      Args:
          node: An instance of the Node class (can be a tree of Nodes).
  
      Returns:
          (str): Formatted string ready to be printed.
  
      """
  
      if node is None:
          return [], 0, 0, 0
  
      first_line, second_line = [], []
  
      name = str(node.name)
      gap = width = len(name)
  
      left_branch, left_width, left_start, left_end = _build_string(
          node.left
      )
      right_branch, right_width, right_start, right_end = _build_string(
          node.right
      )
  
      if left_width > 0:
          left = (left_start + left_end) // 2 + 1
  
          first_line.append(" " * (left + 1))
          first_line.append("_" * (left_width - left))
  
          second_line.append(" " * left + "/")
          second_line.append(" " * (left_width - left))
  
          start = left_width + 1
          gap += 1
      else:
          start = 0
  
      first_line.append(name)
      second_line.append(" " * width)
  
      if right_width > 0:
          right = (right_start + right_end) // 2
  
          first_line.append("_" * right)
          first_line.append(" " * (right_width - right + 1))
  
          second_line.append(" " * right + "\\")
          second_line.append(" " * (right_width - right))
  
          gap += 1
  
      end = start + width - 1
      gap = " " * gap
  
      lines = ["".join(first_line), "".join(second_line)]
  
      for i in range(max(len(left_branch), len(right_branch))):
          if i < len(left_branch):
              left_line = left_branch[i]
          else:
              left_line = " " * left_width
  
          if i < len(right_branch):
              right_line = right_branch[i]
          else:
              right_line = " " * right_width
  
          lines.append(left_line + gap + right_line)
  
      return lines, len(lines[0]), start, end
  
imports: from __future__ import annotations
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import opytimizer.utils.constant
  import opytimizer.utils.exception
label_desc: Use image node_id 1 for calling a global function with example usage: _build_string(node) and returns: lines,  len,  start,  end, list,  int,  int,  int