def clean(self):
if self.response.type == '<STR_LIT:application/json>':<EOL><INDENT>cleaned = copy.deepcopy(self.response.data)<EOL>if self.cleaner is not None:<EOL><INDENT>cleaned = self.cleaner(cleaned)<EOL><DEDENT>typed_response = {<EOL>dict: DictResponse,<EOL>int: IntResponse,<EOL>}.get(type(cleaned), BaseResponse)<EOL>self.response = typed_response.from_cleaned(self.response, cleaned)<EOL><DEDENT>else:<EOL><INDENT>self.response = FileResponse(self.response.response)<EOL><DEDENT>
Clean response.