code: def set_level(node, level, internal_id):
      internal_id["id"] += 1
      node["level"] = level
      node["value"] = node["stop_at"] - node["start_at"]
      node["value_thread"] = (
          node["stop_at_thread"] - node["start_at_thread"]
      )
      node["value_process"] = (
          node["stop_at_process"] - node["start_at_process"]
      )
      node["internal_id"] = internal_id["id"]
  
      accum = 0
      for child_node in node["children"]:
          set_level(child_node, level + 1, internal_id)
          accum += child_node["value"]
      node["self"] = node["value"] - accum
  
imports: import os
  import json
  import psycopg
  from mindsdb.utilities import log
label_desc: Use image node_id 1 for calling a global function with example usage: set_level(node, level, internal_id) without return types