def __branch(self, request):
        """
            Find the best match for request within the subtree, recursive
            helper method for branch().

            @param request: the request object
        """

        items = self.get_all(enabled=True)
        l = self.match(request)
        if not items:
            return self, l
        else:
            match, maxlevel = None, l - 1
            for i in items:
                item, level = i.__branch(request)
                if item is not None and maxlevel > level:
                    match = item
                    maxlevel = level
            if match is not None:
                return match, maxlevel
            else:
                return self, l

    # -------------------------------------------------------------------------
    # Representation methods
    #
    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3navigation.py/S3NavigationItem.__branch/swapped operands of `>`