def coerce_row_to_dict(schema, row):
    """

    >>> from datashape import dshape

    >>> schema = dshape('{x: int, y: int}')
    >>> coerce_row_to_dict(schema, (1, 2)) # doctest: +SKIP
    {'x': 1, 'y': 2}

    Idempotent
    >>> coerce_row_to_dict(schema, {'x': 1, 'y': 2}) # doctest: +SKIP
    {'x': 1, 'y': 2}
    """
    if isinstance(row, dict):
        return row
    return dict((name, item) for name, item in zip(schema[0].names, row))