INNER CODE UNIT · Python

indent

astroautomata/SymbolicRegression.jl · benchmark/analyze.py:32

        indent = len(l) - 1
        same_level = indent == parent.data["indent"]
        if same_level:
            break

        is_child = indent == parent.data["indent"] + 1
        too_nested = indent > 25
        if is_child and not too_nested:
            tokens = l[-1].split()
            time = int(tokens[0])
            info = " ".join(tokens[1:])
            new_node = Node()
            new_node.data = {"time": time, "info": info, "indent": indent}
            new_node.parent = parent
            collect_children(new_node, line_idx + 1)
            new_node.children = sorted(new_node.children, key=lambda n: -n.data["time"])
            parent.children.append(new_node)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…