def group_steps(steps):
    steps = sorted(steps, key=lambda step: step.type)
    seen_steps = set()
    grouped_steps = []
    for step in (itertools.chain.from_iterable(
            sorted(group, key=lambda step: step.name)
            for _, group in itertools.groupby(steps, lambda step: step.type))):
        if step.name not in seen_steps:
            grouped_steps.append(step)
            seen_steps.add(step.name)
    grouped_steps.sort(key=lambda step: STEP_TYPES.index(step.type))
    return grouped_steps
This method is called when the daemon receives a SIGTERM
dataset/ETHPy150Open pytest-dev/pytest-bdd/pytest_bdd/generation.py/group_steps--crossover with--dataset/ETHPy150Open airbnb/airflow/airflow/executors/base_executor.py/BaseExecutor.terminate