code: def test_add_archive_leading_dir(self):
      import os
  
      os.mkdir(self.ds.pathobj / "sub")
      f123 = Path("sub") / "123.tar"
      Path(self.ds.pathobj / "1.tar").rename(
          self.ds.pathobj / Path(f123)
      )
      self.annex.remove("1.tar", force=True)
      self.ds.save(message="renamed")
  
      self.ds.add_archive_content(
          f123, add_archive_leading_dir=True, strip_leading_dirs=True
      )
  
      ok_file_under_git(
          self.ds.path,
          str(Path("sub") / "123" / "file.txt"),
          annexed=True,
      )
  
imports: import os
  import tempfile
  from glob import glob
  from os import unlink
  from os.path import basename, exists
  from os.path import join
  from os.path import lexists, pardir
  from pathlib import Path
  from datalad.api import Dataset, add_archive_content, clean
  from datalad.consts import ARCHIVES_SPECIAL_REMOTE, DATALAD_SPECIAL_REMOTES_UUIDS
  from datalad.support.exceptions import CommandError, NoDatasetFound
  from datalad.support.external_versions import external_versions
  from datalad.tests.utils_pytest import assert_cwd_unchanged, assert_equal, assert_false, assert_in, assert_in_results, assert_not_in, assert_raises, assert_repo_status, assert_result_values_cond, assert_true, create_tree, eq_, integration, known_failure_windows, ok_, ok_archives_caches, ok_file_has_content, ok_file_under_git, serve_path_via_http, skip_if, skip_if_adjusted_branch, swallow_outputs, with_tempfile, with_tree, xfail_buggy_annex_info
  from datalad.utils import chpwd, find_files, get_tempfile_kwargs, getpwd, on_windows, rmtemp
label_desc: Use image node_id 4 for calling the TestAddArchiveOptions obj's underlying member method code with example usage: obj.test_add_archive_leading_dir() without return types