code: def parts_to_ranks(client, worker_info, part_futures):
      """
      Builds a list of (rank, size) tuples of partitions
      :param worker_info: dict of {worker, {"rank": rank }}. Note: \
          This usually comes from the underlying communicator
      :param part_futures: list of (worker, future) tuples
      :return: [(part, size)] in the same order of part_futures
      """
      futures = [
          (
              worker_info[wf[0]]["rank"],
              client.submit(
                  _func_get_rows, wf[1], workers=[wf[0]], pure=False
              ),
          )
          for idx, wf in enumerate(part_futures)
      ]
  
      sizes = client.compute(
          list(map(lambda x: x[1], futures)), sync=True
      )
      total = reduce(lambda a, b: a + b, sizes)
  
      return [
          (futures[idx][0], size) for idx, size in enumerate(sizes)
      ], total
  
file_path: cuml/python/cuml/dask/common/part_utils.py
imports: from cuml.dask.common.utils import parse_host_port
  from dask_cudf.core import Series
  from cuml.internals.safe_imports import gpu_only_import_from
  from dask.dataframe import Series
  from dask.dataframe import DataFrame
  from dask.array.core import Array
  from toolz import first
  from dask.distributed import futures_of, default_client, wait
  from collections.abc import Sequence
  from tornado import gen
  from functools import reduce
  from collections import OrderedDict
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: parts_to_ranks(client, worker_info, part_futures) and returns: unknown,  total