code: def test_memory_table_sort_by_reference_type():
      unsort = [
          ReferenceType.USED_BY_PENDING_TASK,
          ReferenceType.LOCAL_REFERENCE,
          ReferenceType.LOCAL_REFERENCE,
          ReferenceType.PINNED_IN_MEMORY,
      ]
      entries = [
          build_entry(reference_type=reference_type)
          for reference_type in unsort
      ]
      memory_table = MemoryTable(
          entries, sort_by_type=SortingType.REFERENCE_TYPE
      )
      sort = sorted([entry.value for entry in unsort])
      for reference_type, entry in zip(sort, memory_table.table):
          assert reference_type == entry.reference_type
  
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 13 for calling a global function with example usage: test_memory_table_sort_by_reference_type() without return types