def lesser_of_two_evens(a, b):
    """
     a function that returns the lesser of two given numbers if both numbers are even,
    but returns the greater if one or both numbers are odd
    :param a: int
    :param b: int
    :return: int
    lesser_of_two_evens(2,4) --> 2
    lesser_of_two_evens(2,5) --> 5
    """
    if a % 2 == 0 and b % 2 == 0:
        return min(a, b)
    else:
        return max(a, b)