code: def test_group_by():
      node_second = "127.0.0.2"
      node_first = "127.0.0.1"
      entries = [
          build_entry(node_address=node_second, pid=2),
          build_entry(node_address=node_second, pid=1),
          build_entry(node_address=node_first, pid=2),
          build_entry(node_address=node_first, pid=1),
      ]
      memory_table = MemoryTable(entries)
  
      # Make sure it is correctly grouped
      assert node_first in memory_table.group
      assert node_second in memory_table.group
  
      # make sure pid is sorted in the right order.
      for group_key, group_memory_table in memory_table.group.items():
          pid = 1
          for entry in group_memory_table.table:
              assert pid == entry.pid
              pid += 1
  
file_path: ray/dashboard/tests/test_memory_utils.py
imports: import ray
  from ray.dashboard.memory_utils import ReferenceType, decode_object_ref_if_needed, MemoryTableEntry, MemoryTable, SortingType
label_desc: Use image node_id 15 for calling a global function with example usage: test_group_by() without return types