code: def test_memory_table_sort_by_pid():
      unsort = [1, 3, 2]
      entries = [build_entry(pid=pid) for pid in unsort]
      memory_table = MemoryTable(entries, sort_by_type=SortingType.PID)
      sort = sorted(unsort)
      for pid, entry in zip(sort, memory_table.table):
          assert pid == entry.pid
  
file_path: ray/python/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 12 for calling a global function with example usage: test_memory_table_sort_by_pid() without return types