def compose(op, f1, f2):
    """
    A function to compose functions

    :type op: func
    :param op: A two argument function
    :type f1,f2: float, int, bool, func
    :param f1,f2: value or function, given function should take one argument,
        if value given, it will be changed in to one-argument function
    :rtype: func
    :return: A one argument function
    """
    wrap = lambda arg: arg if callable(arg) else lambda x: arg
    return lambda x: op(wrap(f1)(x), wrap(f2)(x))
