docs: def make_iml4(R, iml_disagg, imtls=None, poes_disagg=(None,), curves=()):
      """
      :returns: an ArrayWrapper over a 4D array of shape (N, R, M, P)
      """
      if imtls is None:
          imtls = {imt: [iml] for imt, iml in iml_disagg.items()}
      N = len(curves) or 1
      M = len(imtls)
      P = len(poes_disagg)
      arr = numpy.zeros((N, R, M, P))
      imts = [from_string(imt) for imt in imtls]
      for m, imt in enumerate(imtls):
          imls = imtls[imt]
          for p, poe in enumerate(poes_disagg):
              for r in range(R):
                  arr[:, r, m, p] = _imls(curves, poe, imt, imls, r)
      return ArrayWrapper(arr, dict(poes_disagg=poes_disagg, imts=imts))