<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_with(self, status=None, raw=None, header=None):
 :param int status: status code :param str raw: body content :param dict header: header section :return: return self for chaining :rtype: Response """


        if status != None:
            self.__status = status

        r = (final(self.__op.responses.get(str(self.__status), None)) or
             final(self.__op.responses.get('default', None)))

        if header != None:
            if isinstance(header, (collections.Mapping, collections.MutableMapping)):
                for k, v in six.iteritems(header):
                    self._convert_header(r, k, v)
            else:
                for k, v in header:
                    self._convert_header(r, k, v)

        if raw != None:
            # update 'raw'
            self.__raw = raw

            if self.__status == None:
                raise Exception('Update status code before assigning raw data')

            if r and r.schema and not self.__raw_body_only:
                # update data from Opeartion if succeed else from responseMessage.responseModel
                content_type = 'application/json'
                for k, v in six.iteritems(self.header):
                    if k.lower() == 'content-type':
                        content_type = v[0].lower()
                        break
                schema = deref(r.schema)
                _type = schema.type
                _format = schema.format
                name = schema.name
                data = self.__op._mime_codec.unmarshal(content_type, self.raw, _type=_type, _format=_format, name=name)
                self.__data = r.schema._prim_(data, self.__op._prim_factory, ctx=dict(read=True))

        return self