format an author affiliation from details

def text_from_affiliation_elements(department, institution, city, country):
    "format an author affiliation from details"
    return ', '.join(element for element in [department, institution, city, country] if element)