<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

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)