def TaskTransformer(task, _, context):
  """Takes the form:

  {
    <task id> : {
      ...
    }
  }

  And turns it into:

  {
    'state': {
      'change': {...}
      'quest': <string>
      'index': <int>
      'add_execution': {
        ...
      }
    }
  }
  """
  if not context:
    return None

  input_data = context.get(task.id)
  if not input_data:
    return None

  result = {
      'state': {
          'change': task.payload.get('change'),
          'quest': TASK_TYPE_QUEST_MAPPING.get(task.task_type),
          'index': task.payload.get('index', 0),
          'add_execution': input_data,
      }
  }
  context.clear()
  context.update(result)