code: def test_extract_tar_fail_on_duplicates():
      out_tar = "out_tar"
      test_file_name = "test_file.txt"
      open(test_file_name, "w").close()
      tar_path = yatest.common.output_path("test_file_duplicates.tar")
      archive.tar(
          [
              (test_file_name, "dir1/file"),
              (test_file_name, "dir2/file"),
          ],
          tar_path,
      )
  
      # Extracting without strip_components doesn't raise an error
      extract_tar(tar_path, out_tar)
  
      with pytest.raises(Exception, match="duplicated"):
          extract_tar(tar_path, out_tar, strip_components=1)
  
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 5 for calling a global function with example usage: test_extract_tar_fail_on_duplicates() without return types