code: def _write_file(v, files):
      # Convert UploadFile to a NamedTemporaryFile to ensure it's on the disk
      suffix = os.path.splitext(v.filename)[1]
      named_file = tempfile.NamedTemporaryFile(
          delete=False, suffix=suffix
      )
      files.append(named_file)
      named_file.write(v.file.read())
      named_file.close()
      return named_file.name
  
file_path: ludwig/ludwig/utils/server_utils.py
imports: import json
  import os
  import tempfile
  from typing import Any, Dict, Union
  import numpy
  import pandas
  from starlette.datastructures import UploadFile
  from starlette.responses import JSONResponse
  from ludwig.utils.data_utils import NumpyEncoder
label_desc: Use image node_id 2 for calling a global function with example usage: _write_file(v, files) and returns: named_file