code: def write_json_to_temp_file(data):
      
      fp = tempfile.NamedTemporaryFile(delete=False)
      fp.write(json.dumps(data).encode('utf-8'))
      fp.close()
      return fp.name
docs: Writes JSON data to a temporary file and returns the path to it