code: def from_request(cls, request):
      
      mapreduce_spec = MapreduceSpec.from_json_str(request.get("mapreduce_spec"))
      mapper_spec = mapreduce_spec.mapper
      input_reader_spec_dict = json.loads(request.get("input_reader_state"),
                                          cls=json_util.JsonDecoder)
      input_reader = mapper_spec.input_reader_class().from_json(
          input_reader_spec_dict)
      initial_input_reader_spec_dict = json.loads(
          request.get("initial_input_reader_state"), cls=json_util.JsonDecoder)
      initial_input_reader = mapper_spec.input_reader_class().from_json(
          initial_input_reader_spec_dict)
  
      output_writer = None
      if mapper_spec.output_writer_class():
        output_writer = mapper_spec.output_writer_class().from_json(
            json.loads(request.get("output_writer_state", "{}"),
                       cls=json_util.JsonDecoder))
        assert isinstance(output_writer, mapper_spec.output_writer_class()), (
            "%s.from_json returned an instance of wrong class: %s" % (
                mapper_spec.output_writer_class(),
                output_writer.__class__))
  
      handler = util.try_deserialize_handler(request.get("serialized_handler"))
      if not handler:
        handler = mapreduce_spec.mapper.handler
  
      return cls(mapreduce_spec.params["base_path"],
                 mapreduce_spec,
                 str(request.get("shard_id")),
                 int(request.get("slice_id")),
                 input_reader,
                 initial_input_reader,
                 output_writer=output_writer,
                 retries=int(request.get("retries")),
                 handler=handler)
docs: Create new TransientShardState from webapp request.