def METHOD_NAME(self):
    """Align the armature to the move direction"""
    length = self.__moveDirection.length
    if length >= 0.:
        # First checks if the move direction is the opposite of the current
        # direction. If so, applies a small rotation just to avoid a weird
        # delay that alignAxisToVect has in this case.
        vec = self.object.worldOrientation @ Vector([0,1,0])
        try:
            if vec.angle(self.__moveDirection) >= pi - 0.01:
                self.object.applyRotation([0,0,0.01], False)
        except:
            pass
        length = clamp(length * 20, 0, 1) * self.alignSmooth
        self.object.alignAxisToVect(self.__moveDirection, 1, length)
        self.object.alignAxisToVect([0,0,1], 2, 1)