def clean(dirty_dict): # gets rid of None items in dictionaries clean_dict = {k:v for k,v in dirty_dict.items() if v is not None} return clean_dict