docs: def is_valid_intensity_measure_levels(self):
          """
          In order to compute hazard curves, `intensity_measure_types_and_levels`
          must be set or extracted from the risk models.
          """
          invalid = self.no_imls() and not self.risk_files and (
              self.hazard_curves_from_gmfs or self.calculation_mode in
              ('classical', 'disaggregation'))
          return not invalid