def headers_to_container_info(headers, status_int=HTTP_OK):
 headers = dict(((k.lower(), v) for (k, v) in dict(headers).iteritems()))
 return {'status': status_int, 'read_acl': headers.get('x-container-read'), 'write_acl': headers.get('x-container-write'), 'sync_key': headers.get('x-container-sync-key'), 'object_count': headers.get('x-container-object-count'), 'bytes': headers.get('x-container-bytes-used'), 'versions': headers.get('x-versions-location'), 'cors': {'allow_origin': headers.get('x-container-meta-access-control-allow-origin'), 'allow_headers': headers.get('x-container-meta-access-control-allow-headers'), 'expose_headers': headers.get('x-container-meta-access-control-expose-headers'), 'max_age': headers.get('x-container-meta-access-control-max-age')}, 'meta': dict(((key[17:], value) for (key, value) in headers.iteritems() if key.startswith('x-container-meta-')))}

def headers_to_container_info ( headers , status_int = HTTP_OK ) : headers = dict ( ( ( k . lower ( ) , v ) for ( k , v ) in dict ( headers ) . iteritems ( ) ) ) return { 'status' : status_int , 'read_acl' : headers . get ( 'x-container-read' ) , 'write_acl' : headers . get ( 'x-container-write' ) , 'sync_key' : headers . get ( 'x-container-sync-key' ) , 'object_count' : headers . get ( 'x-container-object-count' ) , 'bytes' : headers . get ( 'x-container-bytes-used' ) , 'versions' : headers . get ( 'x-versions-location' ) , 'cors' : { 'allow_origin' : headers . get ( 'x-container-meta-access-control-allow-origin' ) , 'allow_headers' : headers . get ( 'x-container-meta-access-control-allow-headers' ) , 'expose_headers' : headers . get ( 'x-container-meta-access-control-expose-headers' ) , 'max_age' : headers . get ( 'x-container-meta-access-control-max-age' ) } , 'meta' : dict ( ( ( key [ 17 : ] , value ) for ( key , value ) in headers . iteritems ( ) if key . startswith ( 'x-container-meta-' ) ) ) }
construct a cacheable dict of container info based on response headers .