def recurse(node, prev_layer, prev_phase, indent, in_pe_layers):
    [begun, mark, layer, phase] = [node.start_time_s, node.mark, node.layer, node.phase()]
    time = node.end_time_s
    tag = None
    elapsed0 = 'DETAIL'
    elapsed1 = node.elapsed_less_subtracted_ms()
    if (elapsed1 is None):
        raise Exception('Elapsed for {} returned None'.format(node.to_str()))
    if ((not node.is_added_detail()) and (not node.subtract)):
        tag = ((((node.app_phase + '_') + layer) + '_') + phase)
        elapsed0 = elapsed1
        self.stats[tag] = (self.stats.get(tag, 0.0) + elapsed0)
        self.items[tag] = (self.items.get(tag, []) + [((((((mark + ' ') + str(elapsed0)) + ' ') + str(elapsed1)) + ' ') + tag)])
        if (phase in subphases[PHASE_EXECUTION]):
            if (not in_pe_layers.get(layer)):
                pe_tag = ((node.app_phase + '_') + make_tag(layer, PHASE_EXECUTION))
                self.stats[pe_tag] = (self.stats.get(pe_tag, 0.0) + elapsed0)
                self.items[pe_tag] = (self.items.get(pe_tag, []) + [((((((mark + ' ') + str(elapsed0)) + ' ') + str(elapsed1)) + ' ') + pe_tag)])
    if (phase == PHASE_EXECUTION):
        in_pe_layers[layer] = (in_pe_layers.get(layer, 0) + 1)
    for c in node.children:
        recurse(c, (layer or prev_layer), (phase or prev_phase), (indent + '  '), in_pe_layers)
    if (phase == PHASE_EXECUTION):
        in_pe_layers[layer] = (in_pe_layers[layer] - 1)
    return
def recurse(node, prev_layer, prev_phase, indent, in_pe_layers):
    [begun, mark, layer, phase] = [node.start_time_s, node.mark, node.layer, node.phase()]
    time = node.end_time_s
    tag = None
    elapsed0 = 'DETAIL'
    elapsed1 = node.elapsed_less_subtracted_ms()
    if (elapsed1 is None):
        raise Exception('Elapsed for {} returned None'.format(node.to_str()))
    if ((not node.is_added_detail()) and (not node.subtract)):
        tag = ((((node.app_phase + '_') + layer) + '_') + phase)
        elapsed0 = elapsed1
        self.stats[tag] = (self.stats.get(tag, 0.0) + elapsed0)
        self.items[tag] = (self.items.get(tag, []) + [((((((mark + ' ') + str(elapsed0)) + ' ') + str(elapsed1)) + ' ') + tag)])
        if (phase in subphases[PHASE_EXECUTION]):
            if (not in_pe_layers.get(layer)):
                pe_tag = ((node.app_phase + '_') + make_tag(layer, PHASE_EXECUTION))
                self.stats[pe_tag] = (self.stats.get(pe_tag, 0.0) + elapsed0)
                self.items[pe_tag] = (self.items.get(pe_tag, []) + [((((((mark + ' ') + str(elapsed0)) + ' ') + str(elapsed1)) + ' ') + pe_tag)])
    if (phase == PHASE_EXECUTION):
        in_pe_layers[layer] = (in_pe_layers.get(layer, 0) + 1)
    for c in node.children:
        recurse(c, (layer or prev_layer), (phase or prev_phase), (indent + '  '), in_pe_layers)
    if (phase == PHASE_EXECUTION):
        in_pe_layers[layer] = (in_pe_layers[layer] - 1)
    return