code: def _take_snapshot(table, suspicious=None):
      # Take a memory snapshot.
      snapshot = tracemalloc.take_snapshot()
      # Group all memory allocations by their stacktrace (going n frames
      # deep as defined above in tracemalloc.start(n)).
      # Then sort groups by size, then count, then trace.
      top_stats = snapshot.statistics("traceback")
  
      # For the first m largest increases, keep only, if a) first trial or b) those
      # that are already in the `suspicious` set.
      for stat in top_stats[:100]:
          if not suspicious or stat.traceback in suspicious:
              table[stat.traceback].append(stat.size)
  
file_path: ray/python/ray/util/debug.py
imports: from collections import defaultdict, namedtuple
  import gc
  import os
  import re
  import time
  import tracemalloc
  from typing import Callable, List, Optional
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 6 for calling a global function with example usage: _take_snapshot(table, suspicious) without return types