:type data: dict[str, dict[str, str] | str]
        :rtype: satosa.internal_data.InternalResponse
        :param data: A dict representation of an InternalResponse object
        :return: An InternalResponse object
193101
def from_dict(cls, data):
        
        auth_info = _AuthenticationInformation.from_dict(data.get("auth_info"))
        instance = cls(auth_info=auth_info)
        instance.user_id_hash_type = data.get("hash_type")
        instance.attributes = data.get("attributes", {})
        instance.user_id = data.get("user_id")
        instance.requester = data.get("requester")
        return instance
881522
def data(self):
        
        if self._data:
            return self._data

        retval = {}
        data = self.get_request_data()
        for subdata in data:
            for key, value in subdata.iteritems():
                if not key in retval:
                    retval[key] = value

        self._data = retval
        return retval
1179218
def create_from_dictionary(self, datas):
        
        if "code" not in datas:
            raise ValueError("A response code must contain a code in \"%s\"." % repr(datas))

        code = ObjectResponseCode()
        self.set_common_datas(code, str(datas["code"]), datas)

        code.code = int(datas["code"])
        if "message" in datas:
            code.message = str(datas["message"])
        elif code.code in self.default_messages.keys():
            code.message = self.default_messages[code.code]
        if "generic" in datas:
            code.generic = to_boolean(datas["generic"])

        return code
912842
def data(self):
        
        if self._data is None:
            self._data = self.response.content.decode("utf-8")
        return self._data
1014695
def _request_process_json_standard(self, response_data):
        
        data = response_data.get('data', {}).get(self.request_entity, [])
        status = response_data.get('status', 'Failure')
        return data, status
147476
def data(self):
        
        try:
            data = self._data
        except AttributeError:
            data = self._data = json.loads(self.json)
        return data
40690
def to_internal_value(self, data):
        
        if data is None:
            return

        if not isinstance(data, dict):
            self.fail('invalid')
        if not self.allow_empty and len(data) == 0:
            self.fail('empty')

        result, errors = {}, {}
        for lang_code, model_fields in data.items():
            serializer = self.serializer_class(data=model_fields)
            if serializer.is_valid():
                result[lang_code] = serializer.validated_data
            else:
                errors[lang_code] = serializer.errors

        if errors:
            raise serializers.ValidationError(errors)
        return result
919013
def serialize(self, data):
        
        return json.dumps(self._serialize_datetime(data), ensure_ascii=False)
131467
def _dict_to_model(self, data):
        

        try:
            # we can do this because we have same fields
            # in the representation and in the model:
            user = models.User(**data)
        except TypeError:
            # client sent bad data
            raise errors.BadRequest()
        else:
            return user
983350
def with_json(self, data=None, **params):
        
        if isinstance(data, (tuple, list)):
            data = dict(data)

        if params:
            # data must be None or able to be a dict
            if isinstance(data, dict):
                data.update(params)
            elif data is None:
                data = params
            else:
                raise ValueError('Data must be None or a dict if used with params, got: %r' % data)

        req = self.with_headers({'Content-Type': 'application/json', 'Accept': 'application/json'})
        if isinstance(data, basestring):
            # Looks like it's already been encoded
            return req.with_body(data)
        else:
            return req.with_body(json.dumps(data))
262863
def _data_from_response(self, resp_body, key=None):
        
        if key:
            data = resp_body.get(key)
        else:
            data = resp_body.get(self.plural_response_key, resp_body)
        # NOTE(ja): some services, such as keystone returns values as list as
        # {"values": [ ... ]} unlike other services which just return the
        # list.
        if isinstance(data, dict):
            try:
                data = data["values"]
            except KeyError:
                pass
        return data
1184709
def serialize_to_json(self, response_data):
        

        indent = None
        if settings.DEBUG:
            indent = 4

        # Serialize to JSON with Django's encoder: Adds date/time, decimal,
        # and UUID support.
        return json.dumps(response_data, indent=indent, cls=DjangoJSONEncoder)
1310038
def to_internal_value(self, data):
        
        if 'properties' in data:
            data = self.unformat_geojson(data)
        return super(GeoFeatureModelSerializer, self).to_internal_value(data)
1116284
def from_dict(cls, data):
        
        return cls(
            auth_class_ref=data.get("auth_class_ref"),
            timestamp=data.get("timestamp"),
            issuer=data.get("issuer"),
        )
1170884
def set_data(self, data):
        
        for name in self._fields:
            setattr(self, name, data.get(name))
        return self
94558
def decode(self, data: bytes) -> bytes:
        
        if CONTENT_TRANSFER_ENCODING in self.headers:
            data = self._decode_content_transfer(data)
        if CONTENT_ENCODING in self.headers:
            return self._decode_content(data)
        return data
105203
def load_from_json(data):
        
        if isinstance(data, str):
            data = json.loads(data)
        applications = [
            ApplicationResponse.load_from_json(a) for a in data['applications']
        ] if data['applications'] is not None else []
        return RegistryResponse(
            data['query_uri'], data['success'],
            data['has_references'], data['count'], applications
        )