code: def get_loss_builder(dstore, return_periods=None, loss_dt=None):
      
      oq = dstore['oqparam']
      weights = dstore['weights'][:, 0]
      eff_time = oq.investigation_time * oq.ses_per_logic_tree_path
      num_events = countby(dstore['events'].value, 'rlz')
      periods = return_periods or oq.return_periods or scientific.return_periods(
          eff_time, max(num_events.values()))
      return scientific.LossCurvesMapsBuilder(
          oq.conditional_loss_poes, numpy.array(periods),
          loss_dt or oq.loss_dt(), weights, num_events,
          eff_time, oq.risk_investigation_time)
docs: :param dstore: datastore for an event based risk calculation
      :returns: a LossCurvesMapsBuilder instance