code: def _get_test_write_file_and_cpu_buffer(
      tmpdir, ref_buffer, aio_handle=None, index=0
  ):
      test_file = _get_test_write_file(tmpdir, index)
      if aio_handle is None:
          test_buffer = get_accelerator().pin_memory(
              torch.ByteTensor(list(ref_buffer))
          )
      else:
          tmp_buffer = torch.ByteTensor(list(ref_buffer))
          test_buffer = aio_handle.new_cpu_locked_tensor(
              len(ref_buffer), tmp_buffer
          )
          test_buffer.data.copy_(tmp_buffer)
  
      return test_file, test_buffer
  
imports: import pytest
  import os
  import filecmp
  import torch
  import deepspeed
  import deepspeed.comm
  from deepspeed.accelerator import get_accelerator
  from deepspeed.ops.op_builder import AsyncIOBuilder
  from unit.common import DistributedTest
label_desc: Use image node_id 6 for calling a global function with example usage: _get_test_write_file_and_cpu_buffer(tmpdir, ref_buffer, aio_handle, index) and returns: test_file,  test_buffer