code: def get_parent_node(root_node, stat_node_name):
      assert isinstance(root_node, StatNode)
  
      node = root_node
      names = stat_node_name.split(".")
      for i in range(len(names) - 1):
          node_name = ".".join(names[0 : i + 1])
          child_index = node.find_child_index(node_name)
          assert child_index != -1
          node = node.children[child_index]
      return node
  
imports: import time
  from collections import OrderedDict
  from typing import Dict, Sequence
  import functools
  import itertools
  import numpy
  import torch
  import torch.nn
  from .compute_madd import compute_madd
  from .compute_flops import compute_flops
  from .compute_memory import compute_memory
  from .stat_tree import StatTree, StatNode
  from .reporter import report_format
label_desc: Use image node_id 8 for calling a global function with example usage: get_parent_node(root_node, stat_node_name) and returns: node