code: def parse_response(response):
      
      if isinstance(response, tuple):
          if len(response) > 2:
              return response[0], response[1], response[2]
          elif len(response) > 1:
              return response[0], response[1], {}
      try:
          return response.data, response.status_code, response.headers
      except AttributeError:
          return response, 200, {}
docs: Parse a Flask response into a body, a status code, and headers
  
      The returned value from a Flask view could be:
          * a tuple of (response, status) or (response, status, headers)
          * a Response object
          * a string