def _extract_subruns(self, traj, pre_run=False):
if pre_run:<EOL><INDENT>durations_list = traj.f_get_all(self._pre_durations_group_name)<EOL><DEDENT>else:<EOL><INDENT>durations_list = traj.f_get_all(self._durations_group_name)<EOL><DEDENT>subruns = {}<EOL>orders = []<EOL>for durations in durations_list:<EOL><INDENT>for duration_param in durations.f_iter_leaves(with_links=False):<EOL><INDENT>if '<STR_LIT>' in duration_param.v_annotations:<EOL><INDENT>order = duration_param.v_annotations.order<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>duration_param.v_full_name)<EOL><DEDENT>if order in subruns:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>' % order)<EOL><DEDENT>else:<EOL><INDENT>subruns[order] = duration_param<EOL>orders.append(order)<EOL><DEDENT><DEDENT><DEDENT>return [subruns[order] for order in sorted(orders)]<EOL>
Extracts subruns from the trajectory.

        :param traj: Trajectory container

        :param pre_run: Boolean whether current run is regular or a pre-run

        :raises: RuntimeError if orders are duplicates or even missing