def get_relevant_snapshot_images(snapshot_id):
    """Given a snapshot id, detect the relevant clusters and find their
    cached snapshot images.

    Returns a dict whose keys are clusters that need to be synced
    based on the new snapshot and values are the list of snapshot
    images associated with the snapshot.
    """
    steps = Step.query.filter(
        Plan.id == SnapshotImage.plan_id,
        Step.plan_id == Plan.id,
        SnapshotImage.snapshot_id == snapshot_id
    ).all()

    clusters = set()
    for step in steps:
        if step.data and step.data in 'cluster':
            clusters.add(step.data['cluster'])

    return dict([(cluster, get_cached_snapshot_images(cluster)) for cluster in clusters])
dataset/ETHPy150Open dropbox/changes/changes/lib/snapshot_garbage_collection.py/get_relevant_snapshot_images/swapped operands of `in`