def depth_score_helper(self, d, dopt):
        """
        Gets a weighted count of the number of Intervals deeper than dopt.
        :param d: current depth, starting from 0
        :param dopt: optimal maximum depth of a leaf Node
        :rtype: real
        """
        # di is how may levels deeper than optimal d is
        di = d - dopt
        if di > 0:
            count = di * len(self.s_center)
        else:
            count = 0
        if self.right_node:
            count += self.right_node.depth_score_helper(d + 1, dopt)
        if self.left_node:
            count += self.left_node.depth_score_helper(d + 1, dopt)
        return count
def depth_score_helper ( self , d , dopt ) : di = d - dopt if di > 0 : count = di * len ( self . s_center ) else : count = 0 if self . right_node : count += self . right_node . depth_score_helper ( d + 1 , dopt ) if self . left_node : count += self . left_node . depth_score_helper ( d + 1 , dopt ) return count
Gets a weighted count of the number of Intervals deeper than dopt.
        :param d: current depth, starting from 0
        :param dopt: optimal maximum depth of a leaf Node
        :rtype: real