code: def make_hmap(pmap, imtls, poes):
      
      M, P = len(imtls), len(poes)
      hmap = probability_map.ProbabilityMap.build(M, P, pmap, dtype=F32)
      if len(pmap) == 0:
          return hmap  # empty hazard map
      for i, imt in enumerate(imtls):
          curves = numpy.array([pmap[sid].array[imtls(imt), 0]
                                for sid in pmap.sids])
          data = compute_hazard_maps(curves, imtls[imt], poes)  # array (N, P)
          for sid, value in zip(pmap.sids, data):
              array = hmap[sid].array
              for j, val in enumerate(value):
                  array[i, j] = val
      return hmap
docs: Compute the hazard maps associated to the passed probability map.
  
      :param pmap: hazard curves in the form of a ProbabilityMap
      :param imtls: DictArray with M intensity measure types
      :param poes: P PoEs where to compute the maps
      :returns: a ProbabilityMap with size (N, M, P)