<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pinch(self, direction='in', percent=0.6, duration=2.0, dead_zone=0.1):
 """ Squeezing or expanding 2 fingers on the entire screen. Args: direction (:py:obj:`str`):
 pinching direction, only "in" or "out". "in" for squeezing, "out" for expanding percent (:py:obj:`float`):
 squeezing range from or expanding range to of the entire screen duration (:py:obj:`float`):
 time interval in which the action is performed dead_zone (:py:obj:`float`):
 pinching inner circle radius. should not be greater than ``percent`` """


        if direction not in ('in', 'out'):
            raise ValueError('Argument `direction` should be one of "in" or "out". Got {}'.format(repr(direction)))
        if dead_zone >= percent:
            raise ValueError('Argument `dead_zone` should not be greater than `percent`. dead_zoon={}, percent={}'
                             .format(repr(dead_zone), repr(percent)))

        tracks = make_pinching(direction, [0.5, 0.5], [1, 1], percent, dead_zone, duration)
        speed = (percent - dead_zone) / 2 / duration

        # 速度慢的时候，精度适当要提高，这样有助于控制准确
        ret = self.apply_motion_tracks(tracks, accuracy=speed * 0.03)
        return ret