<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_evt_params(self):
 """Compute event parameters."""

        ev = self.event
        glob = {k: v.get_value() for k, v in ev['global'].items()}
        params = {k: v[0].get_value() for k, v in ev['local'].items()}
        prep = {k: v[1].get_value() for k, v in ev['local'].items()}
        slopes = {k: v.get_value() for k, v in ev['sw'].items()}
        f1 = ev['f1'].get_value()
        f2 = ev['f2'].get_value()
        if not f2:
            f2 = None
        band = (f1, f2)

        if not (slopes['avg_slope'] or slopes['max_slope']):
            slopes = None

        evt_dat = event_params(self.data, params, band=band, slopes=slopes,
                               prep=prep, parent=self)

        count = None
        density = None
        if glob['count']:
            count = len(self.data)
        if glob['density']:
            epoch_dur = glob['density_per']
            # get period of interest based on stage and cycle selection
            poi = get_times(self.parent.notes.annot, stage=self.stage,
                            cycle=self.cycle, exclude=True)
            total_dur = sum([x[1] - x[0] for y in poi for x in y['times']])
            density = len(self.data) / (total_dur / epoch_dur)

        return evt_dat, count, density