def make_periodic(foo, t=1):
    """
    Making function periodic.

    Args:
        foo (function): Function to be made periodic.
        t (float): Period.

    Returns:
        function: Periodic function with period t.
    """
    return lambda x: foo(x-x//t*t)