def worker_parameters(mapreduce_spec,
                        shard_id,
                        slice_id,
                        input_reader):
    """Fill in mapper worker task parameters.

    Returned parameters map is to be used as task payload, and it contains
    all the data, required by mapper worker to perform its function.

    Args:
      mapreduce_spec: specification of the mapreduce.
      shard_id: id of the shard (part of the whole dataset).
      slice_id: id of the slice (part of the shard).
      input_reader: InputReader containing the remaining inputs for this
        shard.

    Returns:
      string->string map of parameters to be used as task payload.
    """
    return {"mapreduce_spec": mapreduce_spec.to_json_str(),
            "shard_id": shard_id,
            "slice_id": str(slice_id),
            "input_reader_state": input_reader.to_json_str()}
Fill in mapper worker task parameters.

    Returned parameters map is to be used as task payload, and it contains
    all the data, required by mapper worker to perform its function.

    Args:
      mapreduce_spec: specification of the mapreduce.
      shard_id: id of the shard (part of the whole dataset).
      slice_id: id of the slice (part of the shard).
      input_reader: InputReader containing the remaining inputs for this
        shard.

    Returns:
      string->string map of parameters to be used as task payload.
    
mapreduce/handlers.py