code = _remove_consecutive_duplicates(nb.code)