'Adds a Task or list of Tasks into this Queue.
If a list of more than one Tasks is given, a raised exception does not
guarantee that no tasks were added to the queue (unless transactional is set
to True). To determine which tasks were successfully added when an exception
is raised, check the Task.was_enqueued property.
Push tasks, i.e. those with method not equal to PULL, may not be added to
queues in pull mode. Similarly, pull tasks may not be added to queues in
push mode.
If a TaskAlreadyExistsError or TombstonedTaskError is raised, the caller can
be guaranteed that for each one of the provided tasks, either the
corresponding task was successfully added, or a task with the given name was
successfully added in the past.
Args:
task: A Task instance or a list of Task instances that will be added to
the queue.
transactional: If True, transactional Tasks will be added to the queue but
cannot be run or leased until after the transaction succeeds.  If the
transaction fails then the Tasks will be removed from the queue (and
therefore never run).  If False, the added task(s) are available to run
immediately; any enclosing transaction\'s success or failure is ignored.
Returns:
The Task or list of tasks that was supplied to this method. Successfully
queued Tasks will have a valid queue name and task name after the
call; such Task objects are marked as queued and cannot be added
again.
Note: Task objects returned from transactional adds are not
notified or updated when the enclosing transaction succeeds or fails.
Raises:
BadTaskStateError: if the Task(s) has already been added to a queue.
BadTransactionStateError: if the transactional argument is true but this
call is being made outside of the context of a transaction.
DuplicateTaskNameError: if a Task name is repeated in the request.
InvalidTaskNameError: if a Task name is provided but is not legal.
InvalidTaskError: if both push and pull tasks exist in the task list.
InvalidQueueModeError: if a task with method PULL is added to a queue in
push mode, or a task with method not equal to PULL is added to a queue
in pull mode.
TaskAlreadyExistsError: if a task with the same name as a given name has
previously been added to the queue.
TombstonedTaskError: if a task with the same name as a given name has
previously been added to the queue and deleted.
TooManyTasksError: if task contains more than MAX_TASKS_PER_ADD tasks.
TransactionalRequestTooLargeError: if transactional is True and the total
size of the tasks and supporting request data exceeds
MAX_TRANSACTIONAL_REQUEST_SIZE_BYTES.
Error-subclass on application errors.'

def add(self, task, transactional=False):

    if task:
        return self.add_async(task, transactional).get_result()
    else:
        return []
