def __when_to_run(self, request):
    """ Returns a datetime object of when a task should 
        execute.
    
    Args:
      request: A taskqueue_service_pb.TaskQueueAddRequest
    Returns:
      A datetime object for when the nearest time to run the 
     task is.
    """
    if request.has_eta_usec():
      eta = request.eta_usec()
      return datetime.datetime.fromtimestamp(eta/1000000)
    else:
      return datetime.datetime.now()
dataset/ETHPy150Open AppScale/appscale/AppTaskQueue/distributed_tq.py/DistributedTaskQueue.__when_to_run/original