'Execute all the requests as a single batched HTTP request.
Args:
http: httplib2.Http, an http object to be used in place of the one the
HttpRequest request object was constructed with. If one isn\'t supplied
then use a http object from the requests in this batch.
Returns:
None
Raises:
httplib2.HttpLib2Error if a transport error has occured.
googleapiclient.errors.BatchError if the response is the wrong format.'

@util.positional(1)
def execute(self, http=None):

    if (len(self._order) == 0):
        return None
    if (http is None):
        for request_id in self._order:
            request = self._requests[request_id]
            if (request is not None):
                http = request.http
                break
    if (http is None):
        raise ValueError('Missing    a    valid    http    object.')
    creds = _auth.get_credentials_from_http(http)
    if (creds is not None):
        if (not _auth.is_valid(creds)):
            LOGGER.info('Attempting    refresh    to    obtain    initial    access_token')
            _auth.refresh_credentials(creds)
    self._execute(http, self._order, self._requests)
    redo_requests = {}
    redo_order = []
    for request_id in self._order:
        (resp, content) = self._responses[request_id]
        if (resp['status'] == '401'):
            redo_order.append(request_id)
            request = self._requests[request_id]
            self._refresh_and_apply_credentials(request, http)
            redo_requests[request_id] = request
    if redo_requests:
        self._execute(http, redo_order, redo_requests)
    for request_id in self._order:
        (resp, content) = self._responses[request_id]
        request = self._requests[request_id]
        callback = self._callbacks[request_id]
        response = None
        exception = None
        try:
            if (resp.status >= 300):
                raise HttpError(resp, content, uri=request.uri)
            response = request.postproc(resp, content)
        except HttpError as e:
            exception = e
        if (callback is not None):
            callback(request_id, response, exception)
        if (self._callback is not None):
            self._callback(request_id, response, exception)
