code: def check_return_type(value, expected_type, strict_floats):
      
      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))
docs: 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