code: def pipeline_to_json(pipeline, file_name, versioned=True):
      d = serialize_pipeline(pipeline, versioned=versioned)
      data = json.dumps(d, indent=4, sort_keys=True)
      Path(file_name).write_text(data)
  
file_path: popmon/tools/pipeline_viz.py
imports: import json
  from itertools import cycle
  from pathlib import Path
  import pygraphviz
  from popmon.base import Pipeline
label_desc: Use image node_id 3 for calling a global function with example usage: pipeline_to_json(pipeline, file_name, versioned) without return types