# Path: pyactor/exceptions.py
# class PyActorTimeoutError(Exception):
#     """Wait time expired."""
# 
#     def __init__(self, method='Not specified'):
#         self.method = method
# 
#     def __str__(self):
#         return f"Timeout triggered: {self.method!r}"


from pyactor.exceptions import PyActorTimeoutError
    def successor(self):
        return self.finger[0]

    def find_successor(self, nid):
        try:
            if betweenE(nid, int(self.predecessor.get_id()), int(self.id)):
                return self.proxy
            n = self.proxy.find_predecessor(nid, timeout=2)
            return n.successor(timeout=2)
        except PyActorTimeoutError as e:
            raise e

    def get_predecessor(self):
        return self.predecessor

    def set_predecessor(self, pred):
        self.predecessor = pred

    # Iterative programming
    def find_predecessor(self, nid):
        try:
            if nid == int(self.id):
                return self.predecessor
            n1 = self.proxy
            while not betweenE(nid, int(n1.get_id()),
                               int(n1.successor(timeout=2).get_id())):
                n1 = n1.closest_preceding_finger(nid, timeout=2)
            return n1
        except SuccessorError as e:
            raise e

# Path: pyactor/exceptions.py
# class PyActorTimeoutError(Exception):
#     """Wait time expired."""
# 
#     def __init__(self, method='Not specified'):
#         self.method = method
# 
#     def __str__(self):
#         return f"Timeout triggered: {self.method!r}"


# Path: examples/chord/chord.py
from pyactor.exceptions import PyActorTimeoutError

    def successor(self):
        return self.finger[0]

    def find_successor(self, nid):
        try:
            if betweenE(nid, int(self.predecessor.get_id()), int(self.id)):
                return self.proxy
            n = self.proxy.find_predecessor(nid, timeout=2)
            return n.successor(timeout=2)
        except PyActorTimeoutError as e:
            raise e

    def get_predecessor(self):
        return self.predecessor

    def set_predecessor(self, pred):
        self.predecessor = pred

    # Iterative programming
    def find_predecessor(self, nid):
        try:
            if nid == int(self.id):
                return self.predecessor
            n1 = self.proxy
            while not betweenE(nid, int(n1.get_id()),
                               int(n1.successor(timeout=2).get_id())):
                n1 = n1.closest_preceding_finger(nid, timeout=2)
            return n1
        except SuccessorError as e:
            raise e

        except PyActorTimeoutError as e: