def check_response(response):
status_code = response.status_code<EOL>if <NUM_LIT:100> < status_code < <NUM_LIT>:<EOL><INDENT>return True<EOL><DEDENT>elif status_code == <NUM_LIT> or status_code == <NUM_LIT>:<EOL><INDENT>message = get_response_data(response)<EOL>raise AuthError('<STR_LIT>' + str(status_code) +<EOL>'<STR_LIT>'.format(message))<EOL><DEDENT>elif status_code == <NUM_LIT>:<EOL><INDENT>message = get_response_data(response)<EOL>raise RequestError('<STR_LIT>'.<EOL>format(message))<EOL><DEDENT>else:<EOL><INDENT>message = get_response_data(response)<EOL>raise APIError('<STR_LIT>'.format(message))<EOL><DEDENT>
Checks that a response is successful, raising the appropriate Exceptions otherwise.