def slow_update_result(self, context):  # pylint: disable=too-many-branches
        spec = context.result.spec
        cluster = spec.cluster
        is_freq_iteration = spec.label.startswith('freq_')
        perf_metric = 0
        power_metric = 0
        thermal_adjusted_power = 0
        if is_freq_iteration and cluster == 'big':
            thermal_adjusted_power = self.thermal_correction(context)
        for metric in context.result.metrics:
            if metric.name == self.performance_metric:
                perf_metric = metric.value
            elif thermal_adjusted_power and metric.name in self.big_power_metrics:
                power_metric += thermal_adjusted_power * self.power_scaling_factor
            elif (cluster == 'big') and metric.name in self.big_power_metrics:
                power_metric += metric.value * self.power_scaling_factor
            elif (cluster == 'little') and metric.name in self.little_power_metrics:
                power_metric += metric.value * self.power_scaling_factor
            elif thermal_adjusted_power and self.big_energy_metrics in metric.name:
                power_metric += thermal_adjusted_power / self.run_time * self.power_scaling_factor
            elif (cluster == 'big') and metric.name in self.big_energy_metrics:
                power_metric += metric.value / self.run_time * self.power_scaling_factor
            elif (cluster == 'little') and metric.name in self.little_energy_metrics:
                power_metric += metric.value / self.run_time * self.power_scaling_factor

        if not (power_metric and (perf_metric or not is_freq_iteration)):
            message = 'Incomplete results for {} iteration{}'
            raise InstrumentError(message.format(context.result.spec.id, context.current_iteration))

        if is_freq_iteration:
            index_matter = [cluster, spec.num_cpus,
                            spec.frequency, context.result.iteration]
            data = self.freq_data
        else:
            index_matter = [cluster, spec.num_cpus,
                            spec.idle_state_id, spec.idle_state_desc, context.result.iteration]
            data = self.idle_data
            if self.no_hotplug:
                # due to that fact that hotpluging was disabled, power has to be artificially scaled
                # to the number of cores that should have been active if hotplugging had occurred.
                power_metric = spec.num_cpus * (power_metric / self.number_of_cpus[cluster])

        data.append(index_matter + ['performance', perf_metric])
        data.append(index_matter + ['power', power_metric])
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/instrumentation/energy_model/__init__.py/EnergyModelInstrument.slow_update_result/swapped operands of `in`