<s> from boto . compat import json <EOL> class GlacierResponse ( dict ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , http_response , response_headers ) : <EOL> self . http_response = http_response <EOL> self . status = http_response . status <EOL> self [ u'<STR_LIT>' ] = http_response . getheader ( '<STR_LIT>' ) <EOL> if response_headers : <EOL> for header_name , item_name in response_headers : <EOL> self [ item_name ] = http_response . getheader ( header_name ) <EOL> if http_response . status != <NUM_LIT> : <EOL> if http_response . getheader ( '<STR_LIT:Content-Type>' ) == '<STR_LIT:application/json>' : <EOL> body = json . loads ( http_response . read ( ) . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . update ( body ) <EOL> size = http_response . getheader ( '<STR_LIT>' , None ) <EOL> if size is not None : <EOL> self . size = size <EOL> def read ( self , amt = None ) : <EOL> "<STR_LIT>" <EOL> return self . http_response . read ( amt ) </s>
