code: def split_interface_name(interface, ch_grp=0):
      
  
      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')
      elif interface.startswith('port-channel'):
          interface = interface.replace(" ", "")
          _, intf_type, port = interface.partition('port-channel')
      else:
          intf_type, port = 'ethernet', interface
  
      return intf_type, port
docs: 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