code: def summarize(self):
      # Reset summary.
      total_object_size = 0
      total_local_ref_count = 0
      total_pinned_in_memory = 0
      total_used_by_pending_task = 0
      total_captured_in_objects = 0
      total_actor_handles = 0
  
      for entry in self.table:
          if entry.object_size > 0:
              total_object_size += entry.object_size
          if (
              entry.reference_type
              == ReferenceType.LOCAL_REFERENCE.value
          ):
              total_local_ref_count += 1
          elif (
              entry.reference_type
              == ReferenceType.PINNED_IN_MEMORY.value
          ):
              total_pinned_in_memory += 1
          elif (
              entry.reference_type
              == ReferenceType.USED_BY_PENDING_TASK.value
          ):
              total_used_by_pending_task += 1
          elif (
              entry.reference_type
              == ReferenceType.CAPTURED_IN_OBJECT.value
          ):
              total_captured_in_objects += 1
          elif entry.reference_type == ReferenceType.ACTOR_HANDLE.value:
              total_actor_handles += 1
  
      self.summary = {
          "total_object_size": total_object_size,
          "total_local_ref_count": total_local_ref_count,
          "total_pinned_in_memory": total_pinned_in_memory,
          "total_used_by_pending_task": total_used_by_pending_task,
          "total_captured_in_objects": total_captured_in_objects,
          "total_actor_handles": total_actor_handles,
      }
      return self
  
imports: import base64
  import logging
  from collections import defaultdict
  from enum import Enum
  from typing import List
  import ray
  from ray._private.internal_api import node_stats
  from ray._raylet import ActorID, JobID, TaskID
label_desc: Use image node_id 4 for calling the MemoryTable obj's underlying member method code with example usage: obj.summarize() and returns: self