import functools


def compose(*functions):
    """
    A functional helper for dealing with function compositions. It ignores any None functions, and if all are None,
    it returns None.

    Parameters
    ----------
    *functions
        function arguments to compose

    Returns
    -------
    function or None
        The composition f(g(...)) functions.
    """
    # help from here: https://mathieularose.com/function-composition-in-python/
    def f_of_g(f, g):
        if f is not None and g is not None:
            return lambda x: f(g(x))
        elif f is not None:
            return f
        elif g is not None:
            return g
        else:
            return lambda x: x

    if any(functions):
        return functools.reduce(f_of_g, functions, lambda x: x)
    else:
        return None