code: def from_protobuf(cls, obj):
      self = cls()
      self.name = obj.name
      self.type = str(obj.type).split(".")[1]
      self.start_ns = obj.start_ns
      self.end_ns = obj.end_ns
      self.device_id = obj.device_id
      self.stream_id = obj.stream_id
      self.context_id = obj.context_id
      self.correlation_id = obj.correlation_id
      self.block_x, self.block_y, self.block_z = [
          obj.block_x,
          obj.block_y,
          obj.block_z,
      ]
      self.grid_x, self.grid_y, self.grid_z = [
          obj.grid_x,
          obj.grid_y,
          obj.grid_z,
      ]
      self.shared_memory = obj.shared_memory
      self.registers_per_thread = obj.registers_per_thread
      self.num_bytes = obj.num_bytes
      self.value = obj.value
      self.occupancy = obj.occupancy * 100
      self.blocks_per_sm = obj.blocks_per_sm
      self.warps_per_sm = obj.warps_per_sm
      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 3 for calling the DeviceNode obj's underlying member method code with example usage: obj.from_protobuf(cls, obj) and returns: self