code: def write_num_to_file(num, file_path):
      if file_path is not None and file_path != "":
          output_dir = file_path
      else:
          output_dir = "."
      filename = output_dir
  
      if output_dir != "." and not os.path.exists(
          os.path.dirname(filename)
      ):
          os.makedirs(os.path.dirname(filename))
  
      fo = open(filename, "w+")
      fo.write(str(num))
      fo.close()
  
imports: import argparse
  import os
  import codecs
label_desc: Use image node_id 3 for calling a global function with example usage: write_num_to_file(num, file_path) without return types