You can simply use  "for  key, (unit, ref) in parent_units.items()" instead.