def _create_default_foo_integral(ir, integral_type):
    """Generate code for create_default_<foo>_integral."""
    ret = format['return']
    classname = ir['create_default_%s_integral' % integral_type]
    if classname is None:
        return ret(0)
    else:
        create = format['create foo']
        return ret(create(classname))
