<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_error_reason(response):
 """Extract error reason from the response. It might be either the 'reason' or the entire response """

        try:
            body = response.json()
            if body and 'reason' in body:
                return body['reason']
        except ValueError:
            pass
        return response.content