<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def components(accountable, project_key):
 """ Returns a list of all a project's components. """

    components = accountable.project_components(project_key)
    headers = sorted(['id', 'name', 'self'])
    rows = [[v for k, v in sorted(component.items()) if k in headers]
            for component in components]
    rows.insert(0, headers)
    print_table(SingleTable(rows))