def coerce_record_to_row(schema, rec):
    """

    >>> from datashape import dshape

    >>> schema = dshape('{x: int, y: int}')
    >>> coerce_record_to_row(schema, {'x': 1, 'y': 2})
    [1, 2]

    Idempotent
    >>> coerce_record_to_row(schema, [1, 2])
    [1, 2]
    """
    if isinstance(rec, (tuple, list)):
        return rec
    return [rec[name] for name in schema[0].names]