from typing import Union


def increment_by_n(n: Union[int, float]):
    """Generates a function that
    will increment by n.

    Args:
        n (int): integer to increment by.

    >>> increment_by_n(2)(2)
    4
    """

    def incrementor(base: Union[int, float]):
        return base + n

    return incrementor