code: def test_dereference_always_dir():
      dirname = "dereference_dir"
      archive._make_dirs(dirname + "/inner")
      with open(dirname + "/inner/file.txt", "w") as f:
          f.write("one")
  
      os.symlink("inner", dirname + "/link")
  
      tar_path = yatest.common.output_path(dirname + ".tar")
  
      with open(tar_path, "w") as afile:
          archive.tar(dirname, afile, dereference=True)
  
      extract_tar(tar_path, "out")
      assert list_files("out") == [
          dirname + "/inner/file.txt",
          dirname + "/link/file.txt",
      ]
      with open("out/" + dirname + "/link/file.txt") as afile:
          assert afile.read() == "one"
      assert not os.path.islink("out/" + dirname + "/link")
  
imports: import errno
  import hashlib
  import os
  import shutil
  import socket
  import tarfile
  import threading
  import six
  import pytest
  import yatest.common
  import library.python.archive
label_desc: Use image node_id 24 for calling a global function with example usage: test_dereference_always_dir() without return types