def float_or_int(value):
    """
    To check if the given value is really float or int. If it is int it returns an int type value

    Args:
        value (Union(int, float)): The value to check

    Returns:
        Union(int,float): The value converted to int if possible
    """
    assert isinstance(value, (int, float)
        ), 'The given value is not int or float is instead {}'.format(type(
        value))
    return int(value) if int(value) == value else value
