def remove_trailing_media_div(self):

        def get_depth(node, depth=1):
            """Computes depth of an lxml element via BFS, this would be
            in parser if it were used anywhere else besides this method
            """
            children = self.parser.getChildren(node)
            if not children:
                return depth
            max_depth = 0
            for c in children:
                e_depth = get_depth(c, depth + 1)
                if e_depth > max_depth:
                    max_depth = e_depth
            return max_depth

        top_level_nodes = self.parser.getChildren(self.get_top_node())
        if len(top_level_nodes) < 3:
            return

        last_node = top_level_nodes[-1]
        if get_depth(last_node) >= 2:
            self.parser.remove(last_node)
Mean pooling layer.  There are no learnable parameters in this layer type.
dataset/ETHPy150Open codelucas/newspaper/newspaper/outputformatters.py/OutputFormatter.remove_trailing_media_div--crossover with--dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/convnet.py/MeanPoolingLayer.__init__