code: def test_group_by_sort_by(ray_start_regular):
      address = ray_start_regular["address"]
  
      @ray.remote
      def f(y):
          x_id = ray.put("HI")
          info_a = memory_summary(
              address, group_by="STACK_TRACE", sort_by="REFERENCE_TYPE"
          )
          info_b = memory_summary(
              address, group_by="NODE_ADDRESS", sort_by="OBJECT_SIZE"
          )
          info_c = memory_summary(
              address, group_by="NODE_ADDRESS", sort_by="PID"
          )
          del x_id
          return info_a, info_b, info_c
  
      x_id = f.remote(np.zeros(100000))
      info_a, info_b, info_c = ray.get(x_id)
      print(info_c)
      assert count(info_a, STACK_TRACE) == 7, info_a
      assert count(info_a, REFERENCE_TYPE) == 1, info_a
      assert count(info_b, NODE_ADDRESS) == 3, info_b
      assert count(info_b, OBJECT_SIZE) == 1, info_b
      assert count(info_c, NODE_ADDRESS) == 3, info_c
      assert count(info_c, PID) == 1, info_c
  
file_path: ray/python/ray/tests/test_memstat.py
imports: import os
  import time
  import numpy
  import pytest
  import ray
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import Semaphore, wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 10 for calling a global function with example usage: test_group_by_sort_by(ray_start_regular) and returns: info_a,  info_b,  info_c