<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datacenters(gandi, id):
 """List available datacenters."""

    output_keys = ['iso', 'name', 'country', 'dc_code', 'status']
    if id:
        output_keys.append('id')

    result = gandi.datacenter.list()
    for num, dc in enumerate(result):
        if num:
            gandi.separator_line()
        output_datacenter(gandi, dc, output_keys, justify=10)

    return result