def render_groups self group result def do_render_group for in group S

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def render_groups(self):
group = []
result = []
def do_render_group():
for j in group:
# Some fancy logic here
result.append(j)
prev_value = None
for obj in self._data:
if (obj.value != prev_value):
do_render_group()
group = []
group.append(obj)
prev_value = obj.prev_value
if (len(group) > 0):
do_render_group()
return result