use dict comprehention in a method
move get_dups to a method