code: def save_model_config(config, model_dir, file_name="config.json"):
      if is_local_path(model_dir):  # save to local path
          with open(os.path.join(model_dir, file_name), "w") as f:
              json.dump(config, f)
      else:  # save to remote path
          with tempfile.TemporaryDirectory() as tmpdirname:
              local_path = os.path.join(tmpdirname, file_name)
              remote_path = os.path.join(model_dir, file_name)
              with open(local_path, "w") as f:
                  json.dump(config, f)
              put_local_file_to_remote(local_path, remote_path)
  
file_path: BigDL/python/orca/tutorial/NCF/utils.py
imports: import os
  import argparse
  import json
  import tempfile
  from bigdl.dllib.utils.file_utils import is_local_path
  from bigdl.orca.data.file import put_local_file_to_remote, get_remote_file_to_local
  from bigdl.orca import init_orca_context, stop_orca_context, OrcaContext
label_desc: Use image node_id 5 for calling a global function with example usage: save_model_config(config, model_dir, file_name) without return types