# Path: autonetkit/network_model/exceptions.py
# class PortNotFound(Exception):
#     pass
# 
# Path: autonetkit/network_model/types.py
# class DeviceType(Enum):
# class PortType(Enum):
#     ROUTER = "Router"
#     SWITCH = "Switch"
#     HOST = "Host"
#     VIRTUAL = "Virtual"
#     BROADCAST_DOMAIN = "Broadcast Domain"
# LAYER3_DEVICES = {DeviceType.ROUTER, DeviceType.HOST}
#     PHYSICAL = "Physical"
#     LOGICAL = "Logical"


import typing
from autonetkit.network_model.exceptions import PortNotFound
from autonetkit.network_model.types import NodeId, DeviceType, PortType
    from autonetkit.network_model.topology import Topology
    from autonetkit.network_model.port import Port
    from autonetkit.network_model.link import Link
        return result

    def peer_ports(self) -> typing.List['Port']:
        """

        @return:
        """
        result = []
        for link in self.links():
            if link.n1 == self:
                result.append(link.p2)
            else:
                result.append(link.p1)

        return result

    def degree(self) -> int:
        """

        @return:
        """
        return len(self.links())

    def loopback_zero(self) -> 'Port':
        """

        @return:
        """
        lo0_id = self.get("lo0_id")
        if lo0_id is None:

# Path: autonetkit/network_model/exceptions.py
# class PortNotFound(Exception):
#     pass
# 
# Path: autonetkit/network_model/types.py
# class DeviceType(Enum):
# class PortType(Enum):
#     ROUTER = "Router"
#     SWITCH = "Switch"
#     HOST = "Host"
#     VIRTUAL = "Virtual"
#     BROADCAST_DOMAIN = "Broadcast Domain"
# LAYER3_DEVICES = {DeviceType.ROUTER, DeviceType.HOST}
#     PHYSICAL = "Physical"
#     LOGICAL = "Logical"


# Path: autonetkit/network_model/node.py
import typing
from autonetkit.network_model.exceptions import PortNotFound
from autonetkit.network_model.types import NodeId, DeviceType, PortType
    from autonetkit.network_model.topology import Topology
    from autonetkit.network_model.port import Port
    from autonetkit.network_model.link import Link

        return result

    def peer_ports(self) -> typing.List['Port']:
        """

        @return:
        """
        result = []
        for link in self.links():
            if link.n1 == self:
                result.append(link.p2)
            else:
                result.append(link.p1)

        return result

    def degree(self) -> int:
        """

        @return:
        """
        return len(self.links())

    def loopback_zero(self) -> 'Port':
        """

        @return:
        """
        lo0_id = self.get("lo0_id")
        if lo0_id is None:

            raise PortNotFound("loopback_zero")