def _get_matched_row(rows, lookup):
    """
    Return row that matches lookup fields.
    """

    for index, row in enumerate(rows):
        matched = True
        for field, value in lookup.items():
            if str(row.get(field, '')).strip() != value:
                matched = False
                break
        if matched:
            return index, row
    return None, None