code: def from_json(cls, json_obj):
      self = cls()
      self.name = json_obj["name"].replace(
          _show_name_pattern.match(json_obj["name"]).group(2), ""
      )
      self.type = json_obj["cat"]
      self.start_ns = int(
          float(json_obj["args"]["start_time"].split(" ")[0]) * 1000
      )
      self.end_ns = int(
          float(json_obj["args"]["end_time"].split(" ")[0]) * 1000
      )
      self.process_id = json_obj["pid"]
      self.thread_id = json_obj["tid"].replace(
          _show_tid_pattern.match(json_obj["tid"]).group(1), ""
      )
      self.correlation_id = (
          json_obj["args"]["correlation id"]
          if "correlation id" in json_obj["args"]
          else -1
      )
      self.input_shapes = (
          json_obj["args"]["input_shapes"]
          if "input_shapes" in json_obj["args"]
          else {}
      )
      self.dtypes = (
          json_obj["args"]["input_dtypes"]
          if "input_dtypes" in json_obj["args"]
          else {}
      )
      self.callstack = (
          json_obj["args"]["callstack"]
          if "callstack" in json_obj["args"]
          else ""
      )
      self.children_node = []
      self.runtime_node = []
      self.device_node = []
      self.mem_node = []
      return self
  
imports: import collections
  import functools
  import json
  import re
  import sys
  import tempfile
  from .utils import traverse_tree
label_desc: Use image node_id 2 for calling the HostNode obj's underlying member method code with example usage: obj.from_json(cls, json_obj) and returns: self