code: def run_server(domain, port, workers):
      app = Sanic("nlg_server")
  
      @app.route("/nlg", methods=["POST", "OPTIONS"])
      async def nlg(request):
          """Endpoint which processes the Core request for a bot response."""
          nlg_call = request.json
          bot_response = await generate_response(nlg_call, domain)
  
          return response.json(bot_response)
  
      app.run(
          host="0.0.0.0",
          port=port,
          workers=workers,
          backlog=int(os.environ.get(ENV_SANIC_BACKLOG, "100")),
      )
  
file_path: rasa/examples/nlg_server/nlg_server.py
imports: import argparse
  import logging
  import os
  from sanic import Sanic, response
  from rasa.shared.core.domain import Domain
  from rasa.core.nlg import TemplatedNaturalLanguageGenerator
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.constants import ENV_SANIC_BACKLOG, DEFAULT_SANIC_WORKERS
label_desc: Use image node_id 2 for calling a global function with example usage: run_server(domain, port, workers) and returns: response