def pinch(self, direction='<STR_LIT>', percent=<NUM_LIT>, duration=<NUM_LIT>, dead_zone=<NUM_LIT:0.1>):
if direction not in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(repr(direction)))<EOL><DEDENT>if dead_zone >= percent:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>.format(repr(dead_zone), repr(percent)))<EOL><DEDENT>w, h = self.get_size()<EOL>x, y = self.get_position()<EOL>tracks = make_pinching(direction, [x, y], [w, h], percent, dead_zone, duration)<EOL>speed = math.sqrt(w * h) * (percent - dead_zone) / <NUM_LIT:2> / duration<EOL>ret = self.poco.apply_motion_tracks(tracks, accuracy=speed * <NUM_LIT>)<EOL>return ret<EOL>
Squeezing or expanding 2 fingers on this UI with given motion range and duration.

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 bounds of the UI
    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``

Raises:
    PocoNoSuchNodeException: raised when the UI element does not exist