<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_line_list(argname, cmd, basename, filename):
 """ Write out the retrieved value as list of lines. """


    values = getattr(cmd.distribution, argname, None)
    if isinstance(values, list):
        values = '\n'.join(values)
    cmd.write_or_delete_file(argname, filename, values, force=True)