def _calculate_mean_and_total_time(self, trace):
        total_time = 0
        steps_with_time = 0

        for trace_step in trace:
            if 'time_spent' in trace_step:
                total_time += trace_step['time_spent']
                steps_with_time += 1

        mean_time = total_time/max(steps_with_time, 1)

        return total_time, mean_time
dataset/ETHPy150Open foundit/Piped/piped/processors/trace_processors.py/DiagramTrace._calculate_mean_and_total_time/original