from typing import OrderedDict


def job_prep_release_status_list_table_format(result):
    """Format job prep-release-status list as a table."""
    table_output = []
    for item in result:
        table_row = OrderedDict()
        table_row['Pool Id'] = item['poolId']
        table_row['Node Id'] = item['nodeId']
        table_row['Job Prep State'] = item['jobPreparationTaskExecutionInfo']['state'] \
            if item['jobPreparationTaskExecutionInfo'] else ""
        table_row['Job Release State'] = item['jobReleaseTaskExecutionInfo']['state'] \
            if item['jobReleaseTaskExecutionInfo'] else ""
        table_output.append(table_row)
    return table_output