code: def _properties(node: Node) -> Dict[str, Any]:
      """Traverses the node and returns some useful properties.
  
      Args:
          node: An instance of the Node class (can be a tree of Nodes).
  
      Returns:
          (Dict[str, Any]): Dictionary containing some useful properties: `min_depth`, `max_depth`,
          `n_leaves` and `n_nodes`.
  
      """
  
      min_depth, max_depth = 0, -1
      n_leaves = n_nodes = 0
  
      nodes = [node]
      while len(nodes) > 0:
          max_depth += 1
  
          next_nodes = []
          for n in nodes:
              n_nodes += 1
  
              if n.left is None and n.right is None:
                  if min_depth == 0:
                      min_depth = max_depth
  
                  n_leaves += 1
  
              if n.left is not None:
                  next_nodes.append(n.left)
  
              if n.right is not None:
                  next_nodes.append(n.right)
  
          nodes = next_nodes
  
      return {
          "min_depth": min_depth,
          "max_depth": max_depth,
          "n_leaves": n_leaves,
          "n_nodes": n_nodes,
      }
  
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 3 for calling a global function with example usage: _properties(node) and returns: dict