def play_bootstrap_tour(<EOL>driver, tour_steps, browser, msg_dur, name=None, interval=<NUM_LIT:0>):
instructions = "<STR_LIT>"<EOL>for tour_step in tour_steps[name]:<EOL><INDENT>instructions += tour_step<EOL><DEDENT>instructions += (<EOL>"""<STR_LIT>""")<EOL>if interval and interval > <NUM_LIT:0>:<EOL><INDENT>if interval < <NUM_LIT:1>:<EOL><INDENT>interval = <NUM_LIT:1><EOL><DEDENT>interval = str(float(interval) * <NUM_LIT>)<EOL>instructions = instructions.replace(<EOL>'<STR_LIT>', '<STR_LIT>' % interval)<EOL><DEDENT>if not is_bootstrap_activated(driver):<EOL><INDENT>activate_bootstrap(driver)<EOL><DEDENT>if len(tour_steps[name]) > <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>if "<STR_LIT>" in tour_steps[name][<NUM_LIT:1>]:<EOL><INDENT>selector = re.search(<EOL>r"<STR_LIT>",<EOL>tour_steps[name][<NUM_LIT:1>]).group(<NUM_LIT:1>)<EOL>selector = selector.replace('<STR_LIT:\\>', '<STR_LIT>').replace('<STR_LIT>', '<STR_LIT>')<EOL>page_actions.wait_for_element_present(<EOL>driver, selector, by=By.CSS_SELECTOR,<EOL>timeout=settings.SMALL_TIMEOUT)<EOL><DEDENT>else:<EOL><INDENT>selector = "<STR_LIT:html>"<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>js_utils.post_messenger_error_message(<EOL>driver, "<STR_LIT>" % selector,<EOL>msg_dur)<EOL>raise Exception(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % selector)<EOL><DEDENT><DEDENT>driver.execute_script(instructions)<EOL>tour_on = True<EOL>while tour_on:<EOL><INDENT>try:<EOL><INDENT>time.sleep(<NUM_LIT>)<EOL>if browser != "<STR_LIT>":<EOL><INDENT>result = driver.execute_script(<EOL>"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>page_actions.wait_for_element_present(<EOL>driver, "<STR_LIT>", by=By.CSS_SELECTOR, timeout=<NUM_LIT>)<EOL>result = False<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>tour_on = False<EOL>result = None<EOL><DEDENT>if result is False:<EOL><INDENT>tour_on = True<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>time.sleep(<NUM_LIT>)<EOL>if browser != "<STR_LIT>":<EOL><INDENT>result = driver.execute_script(<EOL>"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>page_actions.wait_for_element_present(<EOL>driver, "<STR_LIT>", by=By.CSS_SELECTOR, timeout=<NUM_LIT>)<EOL>result = False<EOL><DEDENT>if result is False:<EOL><INDENT>time.sleep(<NUM_LIT:0.1>)<EOL>continue<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>tour_on = False<EOL>time.sleep(<NUM_LIT:0.1>)<EOL><DEDENT><DEDENT><DEDENT>
Plays a Bootstrap tour on the current website.