class_docstr: A generic shuffle operator. Callers should first implement the `map` and
  `reduce` static methods then choose a plan to execute the shuffle by
  inheriting from the appropriate class. A SimpleShufflePlan is provided
  below. Any custom arguments for map and reduce tasks should be specified by
  setting `ShuffleOp._map_args` and `ShuffleOp._reduce_args`.
class_docstr_tok: ["A","generic","shuffle","operator",".","Callers","should","first","implement","the","`","map","`","and","`","reduce","`","static","methods","then","choose","a","plan","to","execute","the","shuffle","by","inheriting","from","the","appropriate","class",".","A","SimpleShufflePlan","is","provided","below",".","Any","custom","arguments","for","map","and","reduce","tasks","should","be","specified","by","setting","`","ShuffleOp._map_args","`","and","`","ShuffleOp._reduce_args","`","."]
docstr: Reduce function to be run for each output block.
  
  Args:
      mapper_outputs: List of blocks to reduce.
      partial_reduce: A flag passed by the shuffle operator that
          indicates whether we should partially or fully reduce the
          mapper outputs.
  
  Returns:
      The reduced block and its metadata.
docstr_tok: ["Reduce","function","to","be","run","for","each","output","block",".","Args",":","mapper_outputs",":","List","of","blocks","to","reduce",".","partial_reduce",":","A","flag","passed","by","the","shuffle","operator","that","indicates","whether","we","should","partially","or","fully","reduce","the","mapper","outputs",".","Returns",":","The","reduced","block","and","its","metadata","."]
code: def reduce(
      *mapper_outputs: List[Block],
      partial_reduce: bool = False,
  ) -> (Block, BlockMetadata):
      """
      Reduce function to be run for each output block.
  
      Args:
          mapper_outputs: List of blocks to reduce.
          partial_reduce: A flag passed by the shuffle operator that
              indicates whether we should partially or fully reduce the
              mapper outputs.
  
      Returns:
          The reduced block and its metadata.
      """
      raise NotImplementedError
  
file_path: ray/python/ray/data/_internal/shuffle.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  from ray.data._internal.block_list import BlockList
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data._internal.progress_bar import ProgressBar
  from ray.data._internal.remote_fn import cached_remote_fn
  from ray.data.block import Block, BlockMetadata
label_desc: Use image node_id 3 for calling the ShuffleOp obj's underlying member method code with example usage: obj.reduce() without return types