<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def order_by_header(table, headers):
    '''Convert a list of dicts to a list or OrderedDicts ordered by headers'''
    ordered_table = []
    for row in table:
        # Tricky list comprehension got tricky when needing special handling
        # Lets do this the simplest way we can:
        row = {k:v for k,v in row.items() if k in headers}
        for h in headers:
            if h not in row:
                row[h] = ''
        ordered_row = OrderedDict(sorted(row.items(),
                                         key=lambda x:headers.index(x[0])))
        ordered_table.append(ordered_row)
    return ordered_table