If no value for the key 'stat_producer' is found, a KeyError is raised. Is this what you want to check, or is there a default value of None?