code: def _check_node(
      predicted_node: Node, target_node: Node, check_label: bool
  ) -> bool:
      if check_label and predicted_node.label != target_node.label:
          return False
      predicted_children = _get_node_children(predicted_node)
      target_children = _get_node_children(target_node)
      if len(predicted_children) != len(target_children):
          return False
      for p_child_node, t_child_node in zip(
          predicted_children,
          target_children,
      ):
          if not _check_node(p_child_node, t_child_node, check_label):
              return False
      return True
  
imports: from collections import Counter, defaultdict
  from copy import deepcopy
  from typing import AbstractSet, Any, Callable, Counter, Dict, List, NamedTuple, Optional, Sequence, Tuple
  from pytext.data.data_structures.annotation import INVALID_TREE_INTENT
  from pytext.data.data_structures.node import Node, Span
  from .None import AllConfusions, Confusions, PerLabelConfusions, PRF1Metrics, PRF1Scores, safe_division
label_desc: Use image node_id 14 for calling a global function with example usage: _check_node(predicted_node, target_node, check_label) and returns: True, False, False, False