def METHOD_NAME(func, ranges, **opts):
    if not ranges:
        return 0.0
    a, b = ranges[0]
    integrator = opts["integrator"]
    tol = opts.get("tol")
    if tol is None:
        opts["tol"] = 1.0e-10
        tol = 1.0e-10
    if len(ranges) > 1:
        def subintegral(*u):
            def ff(*z):
                return func(*(u + z))
            val = METHOD_NAME(ff, ranges[1:], **opts)[0]
            return val
        opts["tol"] = 4.0 * tol
        val = integrator(subintegral, a, b, **opts)
        return val
    else:
        val = integrator(func, a, b, **opts)
        return val