code: def bot(app, debug):
      
      if debug is None:
          verify_id(None, None, app)
  
      (id, tmp) = setup_experiment(log)
  
      if debug:
          url = debug
      else:
          heroku_app = HerokuApp(dallinger_uid=app)
          worker = generate_random_id()
          hit = generate_random_id()
          assignment = generate_random_id()
          ad_url = "{}/ad".format(heroku_app.url)
          ad_parameters = "assignmentId={}&hitId={}&workerId={}&mode=sandbox"
          ad_parameters = ad_parameters.format(assignment, hit, worker)
          url = "{}?{}".format(ad_url, ad_parameters)
      bot = bot_factory(url)
      bot.run_experiment()
docs: Run the experiment bot.