<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_status_code(response, codes=None):
 """ Checks response.status_code is in codes. :param requests.request response: Requests response :param list codes: List of accepted codes or callable :raises: StatusCodeError if code invalid """

    codes = codes or [200]
    if response.status_code not in codes:
        raise StatusCodeError(response.status_code)