code: def _task_to_dict(task):
      
      payload = task.payload
      if payload and task.content_type == 'application/json':
          payload = json.loads(payload)
  
      return dict(
          task_id=task.task_id,
          queue_name=task.queue_name,
          eta=_datetime_to_epoch_seconds(task.eta),
          source=task.source,
          created=_datetime_to_epoch_seconds(task.created),
          lease_attempts=task.lease_attempts,
          last_lease=_datetime_to_epoch_seconds(task.last_lease),
          payload=payload,
          content_type=task.content_type)
docs: Converts a WorkQueue to a JSON-able dictionary.