<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_offset(offset, max_value=None):
 """ Verify that an offset is valid True False True True False False """

    if type(offset) not in [int, long]:
        return False

    if offset < 0:
        return False

    if max_value and offset > max_value:
        return False

    return True