def transform_context(self, context, builder):
    node = builder.tree
    while (len(node['label']) > 2):
        node = {'node_type': node['node_type'], 'children': [node], 'label': node['label'][:(- 1)]}
    node['markup_id'] = context['label_id']
    if (node['node_type'] == REGTEXT):
        node = {'node_type': EMPTYPART, 'children': [node], 'label': (node['label'][:1] + ['Subpart'])}
    context['markup_page_type'] = 'reg-section'
    context['tree'] = {'children': [node], 'label': node['label'][:1], 'node_type': REGTEXT}
    context['navigation'] = self.section_navigation(context['label_id'], context['version'])
    return context
def transform_context(self, context, builder):
    node = builder.tree
    while (len(node['label']) > 2):
        node = {'node_type': node['node_type'], 'children': [node], 'label': node['label'][:(- 1)]}
    node['markup_id'] = context['label_id']
    if (node['node_type'] == REGTEXT):
        node = {'node_type': EMPTYPART, 'children': [node], 'label': (node['label'][:1] + ['Subpart'])}
    context['markup_page_type'] = 'reg-section'
    context['tree'] = {'children': [node], 'label': node['label'][:1], 'node_type': REGTEXT}
    context['navigation'] = self.section_navigation(context['label_id'], context['version'])
    return context