code: def from_json(cls, json_obj):
      self = cls()
      self.type = json_obj["cat"]
      self.timestamp_ns = json_obj["ts"] * 1000
      self.addr = (
          hex(int(json_obj["args"]["addr"]))
          if "addr" in json_obj["args"]
          else 0
      )
      self.process_id = json_obj["pid"]
      self.thread_id = json_obj["tid"].replace(
          _show_tid_pattern.match(json_obj["tid"]).group(1), ""
      )
      self.increase_bytes = (
          json_obj["args"]["increase_bytes"]
          if "increase_bytes" in json_obj["args"]
          else 0
      )
      self.place = (
          json_obj["args"]["place"]
          if "place" in json_obj["args"]
          else "Place(cpu)"
      )
      self.current_allocated = (
          json_obj["args"]["current_allocated"]
          if "current_allocated" in json_obj["args"]
          else 0
      )
      self.current_reserved = (
          json_obj["args"]["current_reserved"]
          if "current_reserved" in json_obj["args"]
          else 0
      )
      self.peak_allocated = (
          json_obj["args"]["peak_allocated"]
          if "peak_allocated" in json_obj["args"]
          else 0
      )
      self.peak_reserved = (
          json_obj["args"]["peak_reserved"]
          if "peak_reserved" in json_obj["args"]
          else 0
      )
      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 MemNode obj's underlying member method code with example usage: obj.from_json(cls, json_obj) and returns: self