# 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 logging
import typing
import networkx as nx
        import numpy
from typing import Optional, List, NamedTuple
from autonetkit.network_model.types import DeviceType, PortType, NodeId
    from autonetkit.network_model.node import Node
    from autonetkit.network_model.port import Port
    from autonetkit.network_model.link import Link
    from autonetkit.network_model.topology import Topology
    """
    # returns the newly created merged node
    boundary_data = boundary_elements(topology, nodes)
    topology.remove_nodes_from(nodes)
    topology.remove_links_from(boundary_data.links)

    if not label:
        label = ""

    virtual_node = topology.create_node(DeviceType.VIRTUAL, label=label)

    for p_outside in boundary_data.p_outside:
        p_inside = virtual_node.create_port(PortType.LOGICAL)
        topology.create_link(p_inside, p_outside)

    return virtual_node


def split_link(topology: 'Topology', link: ['Link'],
               label: Optional[str] = None) -> 'Node':
    """

    @param topology:
    @param link:
    @param label:
    @return:
    """
    if not label:
        label = ""


# 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/design/utils/graph_utils.py
import logging
import typing
import networkx as nx
        import numpy
from typing import Optional, List, NamedTuple
from autonetkit.network_model.types import DeviceType, PortType, NodeId
    from autonetkit.network_model.node import Node
    from autonetkit.network_model.port import Port
    from autonetkit.network_model.link import Link
    from autonetkit.network_model.topology import Topology

    """
    # returns the newly created merged node
    boundary_data = boundary_elements(topology, nodes)
    topology.remove_nodes_from(nodes)
    topology.remove_links_from(boundary_data.links)

    if not label:
        label = ""

    virtual_node = topology.create_node(DeviceType.VIRTUAL, label=label)

    for p_outside in boundary_data.p_outside:
        p_inside = virtual_node.create_port(PortType.LOGICAL)
        topology.create_link(p_inside, p_outside)

    return virtual_node


def split_link(topology: 'Topology', link: ['Link'],
               label: Optional[str] = None) -> 'Node':
    """

    @param topology:
    @param link:
    @param label:
    @return:
    """
    if not label:
        label = ""


    virtual_node = topology.create_node(DeviceType.VIRTUAL, label=label)