'Returns a tuple (open_lines, close_lines) containing lists of codelines'

def _get_loop_opening_ending(self, indices):

    open_lines = []
    close_lines = []
    loopstart = 'for    (%(var)s    in    %(start)s:%(end)s){'
    for i in indices:
        open_lines.append((loopstart % {'var': self._print(i.label), 'start': self._print((i.lower + 1)), 'end': self._print((i.upper + 1))}))
        close_lines.append('}')
    return (open_lines, close_lines)
