def format_repeated_pair_list(self, key, root_list, level):
lines = []<EOL>def depth(L):<EOL><INDENT>return isinstance(L, (tuple, list)) and max(map(depth, L)) + <NUM_LIT:1><EOL><DEDENT>if depth(root_list) == <NUM_LIT:2>:<EOL><INDENT>root_list = [root_list]<EOL><DEDENT>for pair_list in root_list:<EOL><INDENT>lines += self.format_pair_list(key, pair_list, level)<EOL><DEDENT>return lines<EOL>
Process (possibly) repeated lists of pairs e.g. POINTs blocks