code: def get_tmp_file_with_buffer(buffer):
      temp_dir = os.path.expanduser("~/tmp")
      if not os.path.exists(temp_dir):
          os.makedirs(temp_dir)
      with tempfile.NamedTemporaryFile(
          "wb", delete=True, dir=temp_dir
      ) as fp:
          fp.write(buffer)
          file_path = fp.name
          yield file_path
  
file_path: qlib/qlib/utils/file.py
imports: import os
  import shutil
  import tempfile
  import contextlib
  from typing import Optional, Text, IO, Union
  from pathlib import Path
  from qlib.log import get_module_logger
label_desc: Use image node_id 4 for calling a global function with example usage: get_tmp_file_with_buffer(buffer) without return types