code: def activate(admin=True, browser=True, name='admin', reflect_all=False):
      
      with app.app_context():
          generate_pks = app.config.get('SANDMAN_GENERATE_PKS', None) or False
          if getattr(app, 'class_references', None) is None or reflect_all:
              app.class_references = collections.OrderedDict()
              generate_endpoint_classes(db, generate_pks)
          else:
              Model.prepare(db.engine)
          prepare_relationships(db, current_app.class_references)
          if admin:
              try:
                  show_pks = current_app.config['SANDMAN_SHOW_PKS']
              except KeyError:
                  show_pks = False
              register_classes_for_admin(db.session, show_pks, name)
      if browser:
          port = app.config.get('SERVER_PORT', None) or 5000
          webbrowser.open('http://localhost:{}/admin'.format(port))
docs: Activate each pre-registered model or generate the model classes and
      (possibly) register them for the admin.
  
      :param bool admin: should we generate the admin interface?
      :param bool browser: should we open the browser for the user?
      :param name: name to use for blueprint created by the admin interface. Set
                   this to avoid naming conflicts with other blueprints (if
                   trying to use sandman to connect to multiple databases
                   simultaneously)