def _move_items_top(d: dict, keys: list[str]) -> dict:
    """Reorder items in a dictionary.

    The first keys will be those specified in `keys`, the rest will
    be in the same order as in the original dictionary.
    """
    new_d = {}
    for key in keys:
        if key in d:
            new_d[key] = d[key]
    for key in d.keys():
        if key not in keys:
            new_d[key] = d[key]
    return new_d
Reorder items in a dictionary.

    The first keys will be those specified in `keys`, the rest will
    be in the same order as in the original dictionary.
    
sweagent/run/inspector_cli.py