def split_interface_name(self, interface, ch_grp=0):
        """Method to split interface type, id from name.

        Takes an interface name or just interface suffix
        and returns interface type and number separately.

        :param interface: interface name or just suffix
        :param ch_grp: if non-zero, ignore interface
                       name and return 'port-channel' grp
        :returns: interface type like 'ethernet'
        :returns: returns suffix to interface name
        """

        interface = interface.lower()
        if ch_grp != 0:
            intf_type = 'port-channel'
            port = str(ch_grp)
        elif ':' in interface:
            intf_type, port = interface.split(':')
        elif interface.startswith('ethernet'):
            interface = interface.replace(" ", "")
            _, intf_type, port = interface.partition('ethernet')
        else:
            intf_type, port = 'ethernet', interface

        return intf_type, port
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py/CiscoNexusMechanismDriver.split_interface_name/original