code: def headers_as_dict(cls, resp):
          
          if six.PY2:
              pairs = [header.split(':', 1) for header in resp.msg.headers]
              return dict([(k, v.strip()) for k, v in pairs])
          else:
              return dict([(k, v.strip()) for k, v in resp.msg._headers])
docs: Turns an array of response headers into a dictionary