def METHOD_NAME(settings):
    name = settings.get("method", DEFAULT_SETTINGS["method"])
    if name == "gzip":
        return GZipCompressor(settings)
    elif name == "zopfli":
        try:
            import zopfli.gzip  # noqa
            return ZopfliCompressor(settings)
        except ImportError:
            logging.error("Unable to import zopfli module")
    elif name == "brotli":
        try:
            import brotli  # noqa
            return BrotliCompressor(settings)
        except ImportError:
            logger.error("Unable to import brotli module")
    else:
        logger.error(f"No such compressor {name}")