<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def output_domain(gandi, domain, output_keys, justify=12):
 """ Helper to output a domain information."""

    if 'nameservers' in domain:
        domain['nameservers'] = format_list(domain['nameservers'])

    if 'services' in domain:
        domain['services'] = format_list(domain['services'])

    if 'tags' in domain:
        domain['tags'] = format_list(domain['tags'])

    output_generic(gandi, domain, output_keys, justify)

    if 'created' in output_keys:
        output_line(gandi, 'created', domain['date_created'], justify)

    if 'expires' in output_keys:
        date_end = domain.get('date_registry_end')
        if date_end:
            days_left = (date_end - datetime.now()).days
        output_line(gandi, 'expires',
                    '%s (in %d days)' % (date_end, days_left),
                    justify)

    if 'updated' in output_keys:
        output_line(gandi, 'updated', domain['date_updated'], justify)