def optional_apply(f, value):
    """
    If `value` is not None, return `f(value)`, otherwise return None.

    >>> optional_apply(int, None) is None
    True
    >>> optional_apply(int, '123')
    123

    Args:
        f: The function to apply on `value`.
        value: The value, maybe None.
    """
    if value is not None:
        return f(value)