Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Str Assign NameStore ListLoad BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListComp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameLoad orelse Assign NameStore AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call NameLoad NameLoad Str NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If CompareGtE Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Return TupleLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign NameStore Call NameLoad For TupleStore NameStore NameStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Return TupleLoad Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad body Raise Call NameLoad Str For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore NameLoad If UnaryOpNot CompareLtELt Num AttributeLoad NameLoad attr Num body Assign NameStore BoolOpOr NameLoad TupleLoad NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpMod Str AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body TryFinally body If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Str attr ListLoad Str NameLoad Str NameLoad If AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr NameLoad orelse Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str For NameStore AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Yield TupleLoad NameLoad NameLoad decorator_list
N/A N/A Batch updates / deletes of storage buckets / blobs.

See: https://cloud.google.com/storage/docs/json_api/v1/how-tos/batch
 email.encoders encode_noop email.generator Generator email.mime.application MIMEApplication email.mime.multipart MIMEMultipart email.parser Parser N/A io N/A json N/A httplib2 N/A six gcloud.exceptions make_exception gcloud.storage.connection Connection MIMEApplicationHTTP N/A MIMEApplication N/A N/A MIME type for ``application/http``.

    Constructs payload from headers and body

    :type method: string
    :param method: HTTP method

    :type uri: string
    :param uri: URI for HTTP request

    :type headers:  dict
    :param headers: HTTP headers

    :type body: text or None
    :param body: HTTP payload
     __init__ N/A N/A self method uri headers body N/A N/A N/A N/A isinstance body dict N/A N/A body N/A N/A json dumps body N/A N/A headers N/A Content-Type application/json N/A N/A headers N/A Content-Length N/A len body N/A N/A body None N/A N/A body N/A lines N/A N/A %s %s HTTP/1.1 N/A method uri N/A N/A N/A lines extend N/A N/A %s: %s N/A key value N/A N/A key value N/A sorted N/A N/A headers items N/A N/A N/A lines append N/A N/A N/A lines append body N/A payload N/A N/A join lines N/A N/A six PY2 N/A N/A N/A N/A MIMEApplication __init__ self payload http encode_noop N/A N/A super_init N/A N/A super MIMEApplicationHTTP self __init__ N/A N/A super_init payload http encode_noop N/A N/A NoContent N/A object N/A N/A Emulate an HTTP '204 No Content' response. N/A status 204 N/A _FutureDict N/A object N/A N/A Class to hold a future value for a deferred request.

    Used by for requests that get sent in a :class:`Batch`.
     get N/A N/A key default N/A None N/A N/A Stand-in for dict.get.

        :type key: object
        :param key: Hashable dictionary key.

        :type default: object
        :param default: Fallback value to dict.get.

        :raises: :class:`KeyError` always since the future is intended to fail
                 as a dictionary.
         N/A N/A KeyError N/A Cannot get(%r, default=%r) on a future N/A key default N/A staticmethod __getitem__ N/A N/A self key N/A N/A N/A Stand-in for dict[key].

        :type key: object
        :param key: Hashable dictionary key.

        :raises: :class:`KeyError` always since the future is intended to fail
                 as a dictionary.
         N/A N/A KeyError N/A Cannot get item %r from a future N/A key N/A __setitem__ N/A N/A self key value N/A N/A N/A Stand-in for dict[key] = value.

        :type key: object
        :param key: Hashable dictionary key.

        :type value: object
        :param value: Dictionary value.

        :raises: :class:`KeyError` always since the future is intended to fail
                 as a dictionary.
         N/A N/A KeyError N/A Cannot set %r -> %r on a future N/A key value N/A N/A Batch N/A Connection N/A N/A Proxy an underlying connection, batching up change operations.

    :type client: :class:`gcloud.storage.client.Client`
    :param client: The client to use for making connections.
     N/A _MAX_BATCH_SIZE 1000 __init__ N/A N/A self client N/A N/A N/A N/A N/A N/A super Batch self __init__ N/A N/A self _client client N/A N/A self _requests N/A N/A N/A self _target_objects N/A N/A _do_request N/A N/A self method url headers data target_object N/A N/A N/A Override Connection:  defer actual HTTP request.

        Only allow up to ``_MAX_BATCH_SIZE`` requests to be deferred.

        :type method: string
        :param method: The HTTP method to use in the request.

        :type url: string
        :param url: The URL to send the request to.

        :type headers: dict
        :param headers: A dictionary of HTTP headers to send with the request.

        :type data: string
        :param data: The data to send as the body of the request.

        :type target_object: object or :class:`NoneType`
        :param target_object: This allows us to enable custom behavior in our
                              batch connection. Here we defer an HTTP request
                              and complete initialization of the object at a
                              later time.

        :rtype: tuple of ``response`` (a dictionary of sorts)
                and ``content`` (a string).
        :returns: The HTTP response object and the content of the response.
         N/A N/A N/A len N/A self _requests N/A self _MAX_BATCH_SIZE N/A N/A N/A ValueError N/A Too many deferred requests (max %d) N/A self _MAX_BATCH_SIZE N/A N/A N/A N/A self _requests append N/A method url headers data N/A result N/A _FutureDict N/A N/A N/A N/A self _target_objects append target_object N/A N/A target_object None N/A N/A N/A target_object _properties result N/A N/A N/A NoContent result N/A _prepare_batch_request N/A N/A self N/A N/A N/A Prepares headers and body for a batch request.

        :rtype: tuple (dict, string)
        :returns: The pair of headers and body of the batch request to be sent.
        :raises: :class:`ValueError` if no requests have been deferred.
         N/A N/A N/A len N/A self _requests 0 N/A N/A N/A ValueError No deferred requests N/A multi N/A MIMEMultipart N/A N/A method uri headers body N/A self _requests N/A N/A subrequest N/A MIMEApplicationHTTP method uri headers body N/A N/A N/A multi attach subrequest N/A N/A six PY3 N/A N/A buf N/A N/A io StringIO N/A N/A buf N/A N/A io BytesIO N/A generator N/A Generator buf False 0 N/A N/A N/A generator flatten multi N/A payload N/A N/A buf getvalue N/A N/A _ body N/A N/A payload split 1 N/A N/A N/A dict N/A multi _headers body N/A _finish_futures N/A N/A self responses N/A N/A N/A Apply all the batch responses to the futures created.

        :type responses: list of (headers, payload) tuples.
        :param responses: List of headers and payloads from each response in
                          the batch.

        :raises: :class:`ValueError` if no requests have been deferred.
         N/A exception_args None N/A N/A N/A len N/A self _target_objects N/A len responses N/A N/A N/A ValueError Expected a response for every request. N/A N/A target_object sub_response N/A zip N/A self _target_objects responses N/A N/A N/A resp_headers sub_payload sub_response N/A N/A N/A 200 N/A resp_headers status 300 N/A N/A exception_args N/A exception_args N/A resp_headers sub_payload N/A N/A N/A target_object None N/A N/A N/A target_object _properties sub_payload N/A N/A exception_args None N/A N/A N/A make_exception exception_args N/A finish N/A N/A self N/A N/A N/A Submit a single `multipart/mixed` request w/ deferred requests.

        :rtype: list of tuples
        :returns: one ``(headers, payload)`` tuple per deferred request.
         N/A N/A headers body N/A N/A self _prepare_batch_request N/A url N/A %s/batch N/A self API_BASE_URL N/A N/A response content N/A N/A N/A N/A self _client _connection _make_request POST url data body headers headers N/A responses N/A list N/A _unpack_batch_response response content N/A N/A N/A self _finish_futures responses N/A responses N/A current N/A N/A self N/A N/A N/A Return the topmost batch, or None. N/A N/A N/A self _client current_batch N/A __enter__ N/A N/A self N/A N/A N/A N/A N/A N/A self _client _push_batch self N/A self N/A __exit__ N/A N/A self exc_type exc_val exc_tb N/A N/A N/A N/A N/A N/A exc_type None N/A N/A N/A N/A self finish N/A N/A N/A N/A N/A self _client _pop_batch N/A N/A _generate_faux_mime_message N/A N/A parser response content N/A N/A N/A Convert response, content -> (multipart) email.message.

    Helper for _unpack_batch_response.
     N/A N/A N/A isinstance content N/A six binary_type N/A N/A content N/A N/A content encode utf-8 N/A content_type N/A response N/A content-type N/A N/A N/A isinstance content_type N/A six binary_type N/A N/A content_type N/A N/A content_type encode utf-8 N/A faux_message N/A N/A join N/A Content-Type:  content_type 
MIME-Version: 1.0

 content N/A N/A six PY2 N/A N/A N/A N/A parser parsestr faux_message N/A N/A N/A N/A parser parsestr N/A N/A faux_message decode utf-8 N/A _unpack_batch_response N/A N/A response content N/A N/A N/A Convert response, content -> [(headers, payload)].

    Creates a generator of tuples of emulating the responses to
    :meth:`httplib2.Http.request` (a pair of headers and payload).

    :type response: :class:`httplib2.Response`
    :param response: HTTP response / headers from a request.

    :type content: string
    :param content: Response payload with a batch response.

    :rtype: generator
    :returns: A generator of header, payload pairs.
     N/A parser N/A Parser N/A message N/A _generate_faux_mime_message parser response content N/A N/A N/A isinstance N/A message _payload list N/A N/A N/A ValueError Bad response:  not multi-part N/A subrequest N/A message _payload N/A N/A N/A status_line rest N/A N/A N/A subrequest _payload split 1 N/A N/A _ status _ N/A N/A status_line split 2 N/A sub_message N/A N/A parser parsestr rest N/A payload N/A sub_message _payload N/A ctype N/A sub_message N/A Content-Type N/A msg_headers N/A dict N/A sub_message _headers N/A N/A msg_headers N/A status status N/A headers N/A N/A httplib2 Response msg_headers N/A N/A ctype N/A N/A ctype startswith application/json N/A N/A payload N/A N/A json loads payload N/A N/A N/A headers payload N/A