docs: def generate_background_ruptures(tom, locations, occurrence, mag, npd,
                                   hdd, upper_seismogenic_depth,
                                   lower_seismogenic_depth, msr=WC1994(),
                                   aspect=1.5, trt=DEFAULT_TRT):
      """
      :param tom:
          Temporal occurrence model as instance of :class:
          openquake.hazardlib.tom.TOM
      :param numpy.ndarray locations:
          Array of locations [Longitude, Latitude] of the point sources
      :param numpy.ndarray occurrence:
          Annual rates of occurrence
      :param float mag:
          Magnitude
      :param npd:
          Nodal plane distribution as instance of :class:
          openquake.hazardlib.pmf.PMF
      :param hdd:
          Hypocentral depth distribution as instance of :class:
          openquake.hazardlib.pmf.PMF
      :param float upper_seismogenic_depth:
          Upper seismogenic depth (km)
      :param float lower_seismogenic_depth:
          Lower seismogenic depth (km)
      :param msr:
          Magnitude scaling relation
      :param float aspect:
          Aspect ratio
      :param str trt:
          Tectonic region type
      :returns:
          List of ruptures
      """
      ruptures = []
      n_vals = len(locations)
      depths = hdd.sample_pairs(n_vals)
      nodal_planes = npd.sample_pairs(n_vals)
      for i, (x, y) in enumerate(locations):
          hypocentre = Point(x, y, depths[i][1])
          surface = get_rupture_surface(mag, nodal_planes[i][1],
                                        hypocentre, msr, aspect,
                                        upper_seismogenic_depth,
                                        lower_seismogenic_depth)
          rupture_probability = (occurrence[i] * nodal_planes[i][0] *
                                 depths[i][0])
          ruptures.append(ParametricProbabilisticRupture(
              mag, nodal_planes[i][1].rake, trt, hypocentre, surface,
              rupture_probability, tom))
      return ruptures