class_docstr: Manage shuffle execution for ray by resolve dependencies between mappers outputs and reducers inputs based on
  mapper and reducer index.
docstr: Get the number of shuffle blocks that a mapper operand outputs,
  which is also the number of the reducers when tiling shuffle operands.
  Note that this might be greater than actual number of the reducers in the subtask graph,
  because some reducers may not be added to chunk graph.
  
  Parameters
  ----------
  subtask : Subtask
      A mapper or reducer subtask.
  Returns
  -------
  n_reducers : int
      The number of shuffle blocks that a mapper operand outputs.
docstr_tok: ["Get","the","number","of","shuffle","blocks","that","a","mapper","operand","outputs",",","which","is","also","the","number","of","the","reducers","when","tiling","shuffle","operands",".","Note","that","this","might","be","greater","than","actual","number","of","the","reducers","in","the","subtask","graph",",","because","some","reducers","may","not","be","added","to","chunk","graph",".","Parameters","--","--","--","--","--","subtask",":","Subtask","A","mapper","or","reducer","subtask",".","Returns","--","--","--","-","n_reducers",":","int","The","number","of","shuffle","blocks","that","a","mapper","operand","outputs","."]
code: def get_n_reducers(self, subtask: Subtask):
      """
      Get the number of shuffle blocks that a mapper operand outputs,
      which is also the number of the reducers when tiling shuffle operands.
      Note that this might be greater than actual number of the reducers in the subtask graph,
      because some reducers may not be added to chunk graph.
  
      Parameters
      ----------
      subtask : Subtask
          A mapper or reducer subtask.
      Returns
      -------
      n_reducers : int
          The number of shuffle blocks that a mapper operand outputs.
      """
      index = self._mapper_indices.get(
          subtask
      ) or self._reducer_indices.get(subtask)
      if index is None:
          raise ValueError(
              f"The {subtask} should be a mapper or a reducer."
          )
      else:
          shuffle_index, _ = index
          return self._mapper_output_refs[shuffle_index].shape[1]
  
file_path: mars/mars/services/task/execution/ray/shuffle.py
imports: import numpy
  from typing import List, Iterable
  from .....core.operand import MapReduceOperand, OperandStage
  from .....utils import lazy_import
  from ....subtask import Subtask, SubtaskGraph
label_desc: Use image node_id 6 for calling the ShuffleManager obj's underlying member method code with example usage: obj.get_n_reducers(subtask) and returns: self