<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_return_type(value, expected_type, strict_floats):
 """Checks that the given return value has the correct type. :param value: Value returned by the method :type value: object :param expected_type: Expected return type :type expected_type: type :param strict_floats: If False, treat integers as floats :type strict_floats: bool """

    if expected_type is None:
        if value is not None:
            raise InvalidReturnTypeError("Returned value is '{}' but None was expected"
                                         .format(value))
    elif not _is_instance(value, expected_type, strict_floats):
        raise InvalidReturnTypeError("Type of return value '{}' does not match expected type {}"
                                     .format(value, expected_type))