def replace_list(self, src_list, dest_list, inplace=False, regex=False):
inplace = validate_bool_kwarg(inplace, '<STR_LIT>')<EOL>values = self.as_array()<EOL>def comp(s, regex=False):<EOL><INDENT>"""<STR_LIT>"""<EOL>if isna(s):<EOL><INDENT>return isna(values)<EOL><DEDENT>if hasattr(s, '<STR_LIT>'):<EOL><INDENT>return _compare_or_regex_search(maybe_convert_objects(values),<EOL>getattr(s, '<STR_LIT>'), regex)<EOL><DEDENT>return _compare_or_regex_search(values, s, regex)<EOL><DEDENT>masks = [comp(s, regex) for i, s in enumerate(src_list)]<EOL>result_blocks = []<EOL>src_len = len(src_list) - <NUM_LIT:1><EOL>for blk in self.blocks:<EOL><INDENT>rb = [blk if inplace else blk.copy()]<EOL>for i, (s, d) in enumerate(zip(src_list, dest_list)):<EOL><INDENT>new_rb = []<EOL>for b in rb:<EOL><INDENT>m = masks[i][b.mgr_locs.indexer]<EOL>convert = i == src_len<EOL>result = b._replace_coerce(mask=m, to_replace=s, value=d,<EOL>inplace=inplace,<EOL>convert=convert, regex=regex)<EOL>if m.any():<EOL><INDENT>new_rb = _extend_blocks(result, new_rb)<EOL><DEDENT>else:<EOL><INDENT>new_rb.append(b)<EOL><DEDENT><DEDENT>rb = new_rb<EOL><DEDENT>result_blocks.extend(rb)<EOL><DEDENT>bm = self.__class__(result_blocks, self.axes)<EOL>bm._consolidate_inplace()<EOL>return bm<EOL>
do a list replace