code: def setup_app(app, throw=True):
      
      success = True
      try:
          for func in SETUP_FUNCS:
              try:
                  func(app)
              except Exception:
                  success = False
                  if throw:
                      raise
                  else:
                      msg = "Failed to run setup function %r(app)"
                      logger.exception(msg, func.__name__)
      finally:
          setattr(app, 'is_set_up', success)
docs: Ensure application is set up to expected configuration. This function is
      typically triggered by the worker_init signal, however it must be called
      manually by codebases that are run only as task producers or from within
      a Python shell.