code: def ensure_conf(app):
      
      name = 'redbeat_conf'
      app = app_or_default(app)
      try:
          config = getattr(app, name)
      except AttributeError:
          config = RedBeatConfig(app)
          setattr(app, name, config)
      return config
docs: Ensure for the given app the the redbeat_conf
      attribute is set to an instance of the RedBeatConfig
      class.