<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def zoom(self, value):
 """Zoom level."""

        if isinstance(value, (int, float)):
            value = (value, value)
        assert len(value) == 2
        self._zoom = np.clip(value, self._zmin, self._zmax)

        # Constrain bounding box.
        self._constrain_pan()
        self._constrain_zoom()

        self.update()