code: def compute_disagg(sitecol, sources, cmaker, iml4, trti, bin_edges,
                     oqparam, monitor):
      # see https://bugs.launchpad.net/oq-engine/+bug/1279247 for an explanation
      # of the algorithm used
      
      result = {'trti': trti, 'num_ruptures': 0}
      # all the time is spent in collect_bin_data
      ruptures = []
      for src in sources:
          ruptures.extend(src.iter_ruptures())
      bin_data = disagg.collect_bin_data(
          ruptures, sitecol, cmaker, iml4,
          oqparam.truncation_level, oqparam.num_epsilon_bins, monitor)
      if bin_data:  # dictionary poe, imt, rlzi -> pne
          for sid in sitecol.sids:
              for (poe, imt, rlzi), matrix in disagg.build_disagg_matrix(
                      bin_data, bin_edges, sid, monitor).items():
                  result[sid, rlzi, poe, imt] = matrix
          result['cache_info'] = monitor.cache_info
          result['num_ruptures'] = len(bin_data.mags)
      return result
docs: :param sitecol:
          a :class:`openquake.hazardlib.site.SiteCollection` instance
      :param sources:
          list of hazardlib source objects
      :param cmaker:
          a :class:`openquake.hazardlib.gsim.base.ContextMaker` instance
      :param iml4:
          an array of intensities of shape (N, R, M, P)
      :param dict trti:
          tectonic region type index
      :param bin_egdes:
          a dictionary site_id -> edges
      :param oqparam:
          the parameters in the job.ini file
      :param monitor:
          monitor of the currently running job
      :returns:
          a dictionary of probability arrays, with composite key
          (sid, rlzi, poe, imt, iml, trti).