code: def model_to_json(model):
      """Serialize a Prophet model to json string.
  
      Model must be fitted. Skips Stan objects that are not needed for predict.
  
      Can be deserialized with model_from_json.
  
      Parameters
      ----------
      model: Prophet model object.
  
      Returns
      -------
      json string that can be deserialized into a Prophet model.
      """
      model_json = model_to_dict(model)
      return json.dumps(model_json)
  
file_path: prophet/python/prophet/serialize.py
imports: from __future__ import absolute_import, division, print_function
  from collections import OrderedDict
  from copy import deepcopy
  from io import StringIO
  import json
  from pathlib import Path
  import numpy
  import pandas
  from prophet.forecaster import Prophet
label_desc: Use image node_id 2 for calling a global function with example usage: model_to_json(model) and returns: json