code: def _evaluate(node: Node) -> np.ndarray:
      """Evaluates a node and outputs its solution array.
  
      Args:
          node: An instance of the Node class (can be a tree of Nodes).
  
      Returns:
          (np.ndarray): Output solution of size (n_variables x n_dimensions).
  
      """
  
      if node:
          x = _evaluate(node.left)
          y = _evaluate(node.right)
  
          if node.category == "TERMINAL":
              return node.value
  
          if node.name == "SUM":
              return x + y
  
          if node.name == "SUB":
              return x - y
  
          if node.name == "MUL":
              return x * y
  
          if node.name == "DIV":
              return x / (y + c.EPSILON)
  
          if node.name == "EXP":
              return np.exp(x)
  
          if node.name == "SQRT":
              return np.sqrt(np.abs(x))
  
          if node.name == "LOG":
              return np.log(np.abs(x) + c.EPSILON)
  
          if node.name == "ABS":
              return np.abs(x)
  
          if node.name == "SIN":
              return np.sin(x)
  
          if node.name == "COS":
              return np.cos(x)
  
      return None
  
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 2 for calling a global function with example usage: _evaluate(node) and returns: None, node, unknown, unknown, unknown, unknown, np, np, np, np, np, np