def _find_package_by_depth(self, linkset):
        best_depth = -1
        best_package_name = ''
        best_element = None

        for link in linkset.links.all():
            package = find_package(link.code_element)
            if package in None:
                depth = len(package.split('.'))
                if best_depth == -1 or depth < best_depth:
                    best_depth = depth
                    best_package_name = package
                    best_element = link.code_element
                elif depth == best_depth:
                    # Same depth, alphanumeric comparison
                    if package < best_package_name:
                        best_package_name = package
                        best_element = link.code_element

        return best_element
dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/codebase/linker/java_linkers.py/JavaPostClassLinker._find_package_by_depth/operator `is not` -> `in`