code: def test_will_extractall_into(
      arcname: Optional[str], expect_failure: bool
  ):
      with tempfile.TemporaryDirectory() as tempdir:
          file_path = Path(tempdir) / "a" / "file.txt"
          file_path.parent.mkdir(parents=True)
          file_path.touch()
  
          with tarfile.open(
              Path(tempdir) / "archive.tar.gz", "w:gz"
          ) as tar:
              tar.add(file_path, arcname=arcname)
  
          if expect_failure:
              with pytest.raises(PermissionError):
                  with tarfile.open(
                      Path(tempdir) / "archive.tar.gz", "r:gz"
                  ) as tar:
                      will_extractall_into(tar, Path(tempdir) / "b")
          else:
              with tarfile.open(
                  Path(tempdir) / "archive.tar.gz", "r:gz"
              ) as tar:
                  will_extractall_into(tar, Path(tempdir) / "b")
  
imports: import tempfile
  import tarfile
  from pathlib import Path
  from typing import Optional
  import pytest
  from gluonts.util import copy_with, will_extractall_into
label_desc: Use image node_id 2 for calling a global function with example usage: test_will_extractall_into(arcname, expect_failure) without return types