code: def __init__(
      self,
      entries: List[MemoryTableEntry],
      group_by_type: GroupByType = GroupByType.NODE_ADDRESS,
      sort_by_type: SortingType = SortingType.PID,
  ):
      self.table = entries
      # Group is a list of memory tables grouped by a group key.
      self.group = {}
      self.summary = defaultdict(int)
      # NOTE YOU MUST SORT TABLE BEFORE GROUPING.
      # self._group_by(..)._sort_by(..) != self._sort_by(..)._group_by(..)
      if group_by_type and sort_by_type:
          self.setup(group_by_type, sort_by_type)
      elif group_by_type:
          self._group_by(group_by_type)
      elif sort_by_type:
          self._sort_by(sort_by_type)
  
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 1 to create a new MemoryTable object  with example: obj = MemoryTable(entries, group_by_type, sort_by_type)