code: func (m *mapperDef) newMapper(c context.Context, j *mapper.Job, shardIdx int) (mapper.Mapper, error) {
  	cfg := &api.JobConfig{}
  	if err := proto.Unmarshal(j.Config.Params, cfg); err != nil {
  		return nil, errors.Annotate(err, "failed to unmarshal JobConfig").Err()
  	}
  	return func(c context.Context, keys []*datastore.Key) error {
  		return m.Func(c, j.ID, cfg, keys)
  	}, nil
  }
docs: // newMapper creates new instance of a mapping function.