code: def show_rotated_image(external=False):
      global rotationApplied
      global currentAngle
      global anchor
      global resizedImgBtn
      global rotateImgBtn
  
      # reset the error label's text
      if lblError["text"] == "Error":
          lblError["text"] = ""
  
      angle = selectedAngle.get()
  
      try:
          # test if the angle value can be represented with a float
          float(angle)
  
          if angle == "":
              angle = "0.0"
              currentAngle = 0.0
              rotationApplied = False
          elif angle == "0.0" or (
              (float(angle) > 0 or float(angle) < 0)
              and math.fmod(float(angle), 360) == 0
          ):
              currentAngle = 0.0
              rotationApplied = False
          else:
              if not external:
                  currentAngle += float(angle)
  
                  mod = math.fmod(currentAngle, 360)
  
                  if currentAngle > 360 or currentAngle < -360:
                      currentAngle = mod
                      rotationApplied = True
                  elif mod == 0:
                      currentAngle = 0.0
                      rotationApplied = False
                  else:
                      rotationApplied = True
  
                  lblCurrentAngle["text"] = str(currentAngle)
  
                  tempAnchorPoint = anchorSelection.get()
  
                  if tempAnchorPoint == "Center":
                      anchor = None
                  elif tempAnchorPoint == "TopLeft":
                      anchor = (0, 0)
                  elif tempAnchorPoint == "TopMiddle":
                      anchor = ((currentImage.width() // 2), 0)
                  elif tempAnchorPoint == "TopRight":
                      anchor = (currentImage.width(), 0)
                  elif tempAnchorPoint == "MiddleLeft":
                      anchor = (0, (currentImage.height() // 2))
                  elif tempAnchorPoint == "MiddleRight":
                      anchor = (
                          currentImage.width(),
                          (currentImage.height() // 2),
                      )
                  elif tempAnchorPoint == "BottomLeft":
                      anchor = (0, currentImage.height())
                  elif tempAnchorPoint == "BottomMiddle":
                      anchor = (
                          (currentImage.width() // 2),
                          currentImage.height(),
                      )
                  elif tempAnchorPoint == "BottomRight":
                      anchor = (
                          currentImage.width(),
                          currentImage.height(),
                      )
  
                  if rotateImgBtn["bg"] == "lightgrey":
                      rotateImgBtn["bg"] = "lightblue"
                      resizedImgBtn["bg"] = "lightgrey"
  
          # only display the rotated version of the image
          if not transformedImage is None:
              rot = caer.transforms.rotate(
                  transformedImage, float(currentAngle), rotPoint=anchor
              )
          else:
              rot = caer.transforms.rotate(
                  currentImage, float(currentAngle), rotPoint=anchor
              )
  
          image_show(rot)
      except Exception as e:
          lblError["text"] = "Error"
          print(str(e))
  
imports: import matplotlib.pyplot
  from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
  from matplotlib.figure import Figure
  from tkinter import *
  from tkinter import filedialog
  import platform
  import math
  import caer
label_desc: Use image node_id 4 for calling a global function with example usage: show_rotated_image(external) without return types