def METHOD_NAME(
    self, icon: QtGui.QIcon, tab_pos: QtWidgets.QTabWidget.TabPosition
) -> QtGui.QIcon:
    """
    Rotate icon to be oriented upward for the given tab position.
    :param icon: Icon to rotate
    :param tab_pos: Tab position to orient icon for
    :return: Rotated icon
    """
    icon_rot = {
        QtWidgets.QTabWidget.East: -90,
        QtWidgets.QTabWidget.West: 90,
    }.get(tab_pos, 0)
    xform = QtGui.QTransform()
    xform.rotate(icon_rot)
    pixmap = icon.pixmap(ICON_SIZE_BUTTON)
    pixmap = pixmap.transformed(xform)
    return QtGui.QIcon(pixmap)