Parse the login xml response
        :param response: the login response from the RETS server
        :return: None
335913
def parse(self, response):
        
        self.headers = response.headers

        if 'xml' in self.headers.get('Content-Type'):
            # Got an XML response, likely an error code.
            xml = xmltodict.parse(response.text)
            self.analyze_reply_code(xml_response_dict=xml)

        lines = response.text.split('\r\n')
        if len(lines) < 3:
            lines = response.text.split('\n')

        for line in lines:
            line = line.strip()

            name, value = self.read_line(line)
            if name:
                if name in self.valid_transactions or re.match(pattern='/^X\-/', string=name):
                    self.capabilities[name] = value
                else:
                    self.details[name] = value
771266
def parse_image_response(self, response):
        
        if 'xml' in response.headers.get('Content-Type'):
            # Got an XML response, likely an error code.
            xml = xmltodict.parse(response.text)
            self.analyze_reply_code(xml_response_dict=xml)

        obj = self._response_object_from_header(
            obj_head_dict=response.headers,
            content=response.content)
        return obj
1162597
def _parse_regr_response(self, response, uri=None, new_authzr_uri=None,
                             terms_of_service=None):
        
        links = _parse_header_links(response)
        if u'terms-of-service' in links:
            terms_of_service = links[u'terms-of-service'][u'url']
        if u'next' in links:
            new_authzr_uri = links[u'next'][u'url']
        if new_authzr_uri is None:
            raise errors.ClientError('"next" link missing')
        return (
            response.json()
            .addCallback(
                lambda body:
                messages.RegistrationResource(
                    body=messages.Registration.from_json(body),
                    uri=self._maybe_location(response, uri=uri),
                    new_authzr_uri=new_authzr_uri,
                    terms_of_service=terms_of_service))
            )
827280
def parse_response(response, format = 'json')
      result = nil

      if format == 'json'
        result = JSON.parse(response)
      elsif format == 'xml'
        result = Nokogiri::XML(response)
      end

      return result
    end
411348
def parse_response(self, response):
        """"""
        try:
            for header in response.msg.get_all("Set-Cookie"):
                cookie = header.split(";", 1)[0]
                cookieKey, cookieValue = cookie.split("=", 1)
                self._cookies[cookieKey] = cookieValue
        finally:
            return Transport.parse_response(self, response)
10340
def parse_requests_response(response, **kwargs):
    

    return parse_headers(
        response.headers.get('content-disposition'), response.url, **kwargs)
285858
def decode_response(client_message, to_object=None):
    
    parameters = dict(response=None)
    parameters['response'] = client_message.read_long()
    return parameters
662557
def parse_response_for(response)
      case response
        when Net::HTTPOK, Net::HTTPCreated then return Response::Success.new(response)
        when Net::HTTPForbidden then raise Response::InvalidCredentials
        when Net::HTTPInternalServerError then raise Response::ServerError
        else raise Response::UnknownError
      end
    end
1000617
def parse_response!
      response.body = case @response_format
        when :xml then Hash.from_xml response.body
        when :json then JSON response.body
      end if response.body
    end
483257
def parse(self, response):
        
        if not self.helper.parse_crawler.content_type(response):
            return

        yield self.helper.parse_crawler.pass_to_pipeline(
            response,
            self.helper.url_extractor.get_allowed_domain(response.url)
        )
578423
def parse_auth_response(self, auth_response):
        

        auth_dict = dict()
        auth_response = auth_response.json()
        LOG.debug('Authentication Response Body [ %s ]', auth_response)

        access = auth_response.get('access')
        access_token = access.get('token')
        access_tenant = access_token.get('tenant')
        access_user = access.get('user')

        auth_dict['os_token'] = access_token.get('id')
        auth_dict['os_tenant'] = access_tenant.get('name')
        auth_dict['os_user'] = access_user.get('name')

        if not auth_dict['os_token']:
            raise exceptions.AuthenticationProblem(
                'When attempting to grab the tenant or user nothing was'
                ' found. No Token Found to Parse. Here is the DATA: [ %s ]'
                ' Stack Trace [ %s ]',
                auth_response,
                traceback.format_exc()
            )

        region = self.job_args.get('os_region')
        print(region)
        if not region:
            raise exceptions.SystemProblem('No Region Set')

        service_catalog = access.pop('serviceCatalog')

        # Get the storage URL
        object_endpoints = self._service_endpoints(
            service_catalog=service_catalog,
            types_list=turbolift.__srv_types__
        )

        # In the legacy internal flag is set override the os_endpoint_type
        #  TODO(cloudnull) Remove this in future releases
        if 'internal' in self.job_args and self.job_args['internal']:
            LOG.warn(
                'The use of the ``--internal`` flag has been deprecated and'
                ' will be removed in future releases. Please use the'
                ' ``--os-endpoint-type`` flag and set the type name'
                ' instead. In the case of using snet (service net) this is'
                ' generally noted as "internalURL". Example setting:'
                ' ``--os-endpoint-type internalURL``'
            )
            self.job_args['os_endpoint_type'] = 'internalURL'

        auth_dict['storage_url'] = get_service_url(
            region=region,
            endpoint_list=object_endpoints,
            lookup=self.job_args['os_endpoint_type']
        )

        # Get the CDN URL
        cdn_endpoints = self._service_endpoints(
            service_catalog=service_catalog, types_list=turbolift.__cdn_types__
        )

        if cdn_endpoints:
            auth_dict['cdn_storage_url'] = get_service_url(
                region=region,
                endpoint_list=cdn_endpoints,
                lookup=self.job_args['cdn_endpoint_type']
            )

        return auth_dict
870872
def parse_one_response(line, ignore_bad_cookies=False,
                       ignore_bad_attributes=True):
    
    cookie_dict = {}
    # Basic validation, extract name/value/attrs-chunk
    match = Definitions.SET_COOKIE_HEADER_RE.match(line)
    if not match:
        if not ignore_bad_cookies:
            raise InvalidCookieError(data=line)
        _report_invalid_cookie(line)
        return None
    cookie_dict.update({
        'name': match.group('name'),
        'value': match.group('value')})
    # Extract individual attrs from the attrs chunk
    for match in Definitions.ATTR_RE.finditer(match.group('attrs')):
        captured = dict((k, v) for (k, v) in match.groupdict().items() if v)
        unrecognized = captured.get('unrecognized', None)
        if unrecognized:
            if not ignore_bad_attributes:
                raise InvalidCookieAttributeError(None, unrecognized,
                                                  "unrecognized")
            _report_unknown_attribute(unrecognized)
            continue
        # for unary flags
        for key in ('secure', 'httponly'):
            if captured.get(key):
                captured[key] = True
        # ignore subcomponents of expires - they're still there to avoid doing
        # two passes
        timekeys = ('weekday', 'month', 'day', 'hour', 'minute', 'second',
                    'year')
        if 'year' in captured:
            for key in timekeys:
                del captured[key]
        elif 'year2' in captured:
            for key in timekeys:
                del captured[key + "2"]
        cookie_dict.update(captured)
    return cookie_dict
1168149
def process_response(self, req, resp, resource):
        
        if 'result' not in req.context:
            return
        req.context['result']['is_login'] = 'user_id' in req.env['session']
        if settings.DEBUG:
            req.context['result']['_debug_queries'] = sys._debug_db_queries
            sys._debug_db_queries = []
        if resp.body is None and req.context['result']:
            resp.body = json.dumps(req.context['result'])

        try:
            log.debug("RESPONSE: %s" % resp.body)
        except:
            log.exception("ERR: RESPONSE CANT BE LOGGED ")
412026
function parseResponse(response) {
    var code = response.statusCode;
    var type = code / 100 | 0;
    response.type = type;

    // basics
    switch (type) {
    case 1:
        response.info = type;
        break;
    case 2:
        response.ok = type;
        break;
    case 3:
        // ???
        break;
    case 4:
        response.clientError = type;
        response.error = type;
        response.ErrorClass = errors.HttpStatusError;
        break;
    case 5:
        response.serverError = type;
        response.error = type;
        response.ErrorClass = errors.HttpStatusError;
        break;
    }

    // error classes and sugar
    switch (code) {
    case 201:
        response.created = code;
        break;
    case 202:
        response.accepted = code;
        break;
    case 204:
        response.noContent = code;
        break;
    case 400:
        response.badRequest = code;
        break;
    case 401:
        response.unauthorized = code;
        response.ErrorClass = errors.AuthenticationRequiredError;
        break;
    case 403:
        response.forbidden = code;
        response.ErrorClass = errors.NotPermittedError;
        break;
    case 404:
        response.notFound = code;
        response.ErrorClass = errors.NotFoundError;
        break;
    case 406:
        response.notAcceptable = code;
        break;
    case 500:
        response.internalServerError = code;
        break;
    }

    // using body (and not status code)
    if (response.body && response.body.success === false) {
        if (!response.error) {
            response.error = 4; // assume is client error
            response.ErrorClass = errors.HttpStatusError;
        }
    }

    // null bodies
    if (_.includes([null, undefined, ""], response.body)) {
        if (!response.error) {
            response.error = 5; // assume the server fucked up
            response.ErrorClass = errors.HttpStatusError;
        }
    }

    return response;
}
114559
def _parse_response(self, resp):
        """"""
        access = resp["access"]
        token = access.get("token")
        self.token = token["id"]
        self.tenant_id = token["tenant"]["id"]
        self.tenant_name = token["tenant"]["name"]
        self.expires = self._parse_api_time(token["expires"])
        self.service_catalog = access.get("serviceCatalog")
        self._parse_service_catalog()
        user = access["user"]
        self.user = {}
        self.user["id"] = user["id"]
        self.username = self.user["name"] = user["name"]
        self.user["roles"] = user["roles"]
845026
def parseRest(self, response):
        
        body = json.loads(response)

        try:
            error = body['error']['description']
            code = body['error']['code']
        except Exception:
            return body['data']
        else:
            raise ClickatellError(error, code);
1317318
def _read_response(self, response):
        
        self.name = response['name']
        self.description = response['description']
        self.autoJoin = response['autoJoin']
        self.realm = response['realm']
        self.realmAttributes = response.get('realmAttributes', None)