code: def format_response(resp_format, parsed_doc):
      """
      Transform string of server's response to the requested format
  
      Args:
          resp_format(str): the desired response format
          parsed_doc: the server's response
  
      Returns:
          formatted response
      """
      logger.info("preparing response JSON")
      ret = None
      if (
          (resp_format == "json")
          or ("json" in resp_format)
          or (not resp_format)
      ):
          # if not specified resp_format then default is json
          ret = parsed_doc
      if resp_format == "gzip" or "gzip" in resp_format:
          ret = gzip_str(parsed_doc)
      return ret
  
file_path: nlp-architect/server/service.py
imports: import json
  import logging
  import os.path
  from importlib import import_module
  from nlp_architect.utils.io import gzip_str
label_desc: Use image node_id 1 for calling a global function with example usage: format_response(resp_format, parsed_doc) and returns: ret