The ```~``` is a "not" operator. That line queries for ```Job``` objects where ```Job.target_nodes == []``` - this is just the SQLA way to do it.