def dismiss(self, targets, exit_when=None, sleep_interval=<NUM_LIT:0.5>, appearance_timeout=<NUM_LIT:20>, timeout=<NUM_LIT>):
try:<EOL><INDENT>self.wait_for_any(targets, timeout=appearance_timeout)<EOL><DEDENT>except PocoTargetTimeout:<EOL><INDENT>warnings.warn('<STR_LIT>'<EOL>.encode('<STR_LIT:utf-8>').format(targets))<EOL>return<EOL><DEDENT>start_time = time.time()<EOL>while True:<EOL><INDENT>no_target = True<EOL>for t in targets:<EOL><INDENT>if t.exists():<EOL><INDENT>try:<EOL><INDENT>for n in t:<EOL><INDENT>try:<EOL><INDENT>n.click(sleep_interval=sleep_interval)<EOL>no_target = False<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>time.sleep(sleep_interval)<EOL>should_exit = exit_when() if exit_when else False<EOL>if no_target or should_exit:<EOL><INDENT>return<EOL><DEDENT>if time.time() - start_time > timeout:<EOL><INDENT>raise PocoTargetTimeout('<STR_LIT>', targets)<EOL><DEDENT><DEDENT>
Automatically dismiss the target objects

Args:
    targets (:obj:`list`): list of poco objects to be dropped
    exit_when: termination condition, default is None which means to automatically exit when list of
     ``targets`` is empty
    sleep_interval: time interval between each actions for the given targets, default is 0.5s
    appearance_timeout: time interval to wait for given target to appear on the screen, automatically exit when
     timeout, default is 20s
    timeout: dismiss function timeout, default is 120s

Raises:
    PocoTargetTimeout: when dismiss time interval timeout, under normal circumstances, this should not happen
     and if happens, it will be reported