<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def view_limits(self, vmin, vmax):
 """ Try to choose the view limits intelligently. """

        b = self._transform.base
        if vmax < vmin:
            vmin, vmax = vmax, vmin

        if not matplotlib.ticker.is_decade(abs(vmin), b):
            if vmin < 0:
                vmin = -matplotlib.ticker.decade_up(-vmin, b)
            else:
                vmin = matplotlib.ticker.decade_down(vmin, b)
        if not matplotlib.ticker.is_decade(abs(vmax), b):
            if vmax < 0:
                vmax = -matplotlib.ticker.decade_down(-vmax, b)
            else:
                vmax = matplotlib.ticker.decade_up(vmax, b)

        if vmin == vmax:
            if vmin < 0:
                vmin = -matplotlib.ticker.decade_up(-vmin, b)
                vmax = -matplotlib.ticker.decade_down(-vmax, b)
            else:
                vmin = matplotlib.ticker.decade_down(vmin, b)
                vmax = matplotlib.ticker.decade_up(vmax, b)
        result = matplotlib.transforms.nonsingular(vmin, vmax)
        return result