code: def _group_chunk_refs(
      chunk_addr_refs: List[Tuple[Tuple, "ray.ObjectRef"]],
      num_shards: int,
  ):
      """Group fetched ray.ObjectRefs into a dict for later use.
  
      Args:
          chunk_addr_refs (List[Tuple[Tuple, ray.ObjectRef]]): a list of tuples of
              band & ray.ObjectRef of each chunk.
          num_shards (int): the number of shards that will be created for the MLDataset.
  
      Returns:
          Dict[str, List[ray.ObjectRef]]: a dict that defines which group of ray.ObjectRefs will
              be in an ChunkRefBatch.
      """
      group_to_obj_refs = defaultdict(list)
      if not num_shards:
          for addr, obj_ref in chunk_addr_refs:
              group_to_obj_refs[addr].append(obj_ref)
      else:
          splits = np.array_split(
              [ref for _, ref in chunk_addr_refs], num_shards
          )
          for idx, split in enumerate(splits):
              group_to_obj_refs["group-" + str(idx)] = list(split)
      return group_to_obj_refs
  
file_path: mars/mars/dataframe/contrib/raydataset/mldataset.py
imports: import numpy
  import pandas
  from collections import defaultdict
  from typing import Dict, Iterable, List, Tuple
  from ....utils import lazy_import
label_desc: Use image node_id 1 for calling a global function with example usage: _group_chunk_refs(chunk_addr_refs, num_shards) and returns: group_to_obj_refs