@staticmethod
    def calc_nesting(subrs):

        def increment_subr_depth(subr, depth):
            if not hasattr(subr, "_max_call_depth") or subr._max_call_depth < depth:
                subr._max_call_depth = depth

            callees = deque([it[1] for it in subr._encoding])

            while len(callees):
                next_subr = callees.pop()
                if next_subr._flatten:
                    callees.extend([it[1] for it in next_subr._encoding])
                elif (not hasattr(next_subr, "_max_call_depth") or 
                            next_subr._max_call_depth < depth + 1):
                        increment_subr_depth(next_subr, depth + 1)

        for subr in subrs:
            if not hasattr(subr, "_max_call_depth"):
                increment_subr_depth(subr, 1)
Update each entry of subrs with their call depth. This
dataset/ETHPy150Open googlei18n/compreffor/compreffor/pyCompressor.py/Compreffor.calc_nesting