<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cmd_scale(self, x=None, y=None, ch=None):
 """scale x=scale_x y=scale_y ch=chname Scale the image for the given viewer/channel by the given amounts. If only one scale value is given, the other is assumed to be the same. If no value is given, reports the current scale. """

        viewer = self.get_viewer(ch)
        if viewer is None:
            self.log("No current viewer/channel.")
            return

        scale_x, scale_y = viewer.get_scale_xy()

        if x is None and y is None:
            self.log("x=%f y=%f" % (scale_x, scale_y))

        else:
            if x is not None:
                if y is None:
                    y = x
            if y is not None:
                if x is None:
                    x = y
            viewer.scale_to(x, y)