code: def parse_rotation(self, rotation=None):
          
          if (rotation is not None):
              self.rotation = rotation
          self.rotation_deg = 0.0
          self.rotation_mirror = False
          if (self.rotation is None):
              return
          # Look for ! prefix first
          if (self.rotation[0] == '!'):
              self.rotation_mirror = True
              self.rotation = self.rotation[1:]
          # Interpret value now
          try:
              self.rotation_deg = float(self.rotation)
          except ValueError:
              raise IIIFRequestError(
                  code=400, parameter="rotation",
                  text="Bad rotation value, must be a number, got '%s'." %
                  (self.rotation))
          if (self.rotation_deg < 0.0 or self.rotation_deg > 360.0):
              raise IIIFRequestError(
                  code=400, parameter="rotation",
                  text="Illegal rotation value, must be 0 <= rotation "
                       "<= 360, got %f." % (self.rotation_deg))
          elif (self.rotation_deg == 360.0):
              # The spec admits 360 as valid, but change to 0
              self.rotation_deg = 0.0
docs: Check and interpret rotation.
  
          Uses value of self.rotation as starting point unless rotation
          parameter is specified in the call. Sets self.rotation_deg to a
          floating point number 0 <= angle < 360. Includes translation of
          360 to 0. If there is a prefix bang (!) then self.rotation_mirror
          will be set True, otherwise it will be False.