code: def save_as_text(image_data: str, output_name: str):
      with codecs.open(output_name, "w", encoding="utf-8") as f:
          f.write(image_data)
  
file_path: pyecharts/pyecharts/render/snapshot.py
imports: import base64
  import codecs
  import logging
  import os
  from io import BytesIO
  from ..types import Any
label_desc: Use image node_id 4 for calling a global function with example usage: save_as_text(image_data, output_name) without return types