docs: def _copyPort(port: LPort, targetParent: Union[LPort], reverseDirection):
      """
      add port to LPort for interface
      """
      d = port.direction
      side = port.side
      if reverseDirection:
          d = PortType.opposite(d)
          side = PortSide.opposite(side)
  
      newP = LPort(targetParent.parentNode, d, side, name=port.name)
      if isinstance(targetParent, LPort):
          targetParent.children.append(newP)
          newP.parent = targetParent
      else:
          targetParent.getPortSideView(side).append(newP)
  
      for ch in port.children:
          _copyPort(ch, newP, reverseDirection)
  
      return newP