def select_stack_report(objects, what):
    """Select the first or the last stack report."""
    assert what in ("first", "last")
    if what == "first":
        return objects[0]
    else:
        return objects[-1]