code: def test_add_archive_dirs(path_orig=None, url=None, repo_path=None):
      # change to repo_path
      with chpwd(repo_path):
          # create annex repo
          ds = Dataset(repo_path).create(force=True)
          repo = ds.repo
          # add archive to the repo so we could test
          with swallow_outputs():
              repo.add_url_to_file("1.tar.gz", opj(url, "1.tar.gz"))
          repo.commit("added 1.tar.gz")
  
          # test with excludes and annex options
          add_archive_content(
              "1.tar.gz",
              existing="archive-suffix",
              # Since inconsistent and seems in many cases no
              # leading dirs to strip, keep them as provided
              strip_leading_dirs=True,
              delete=True,
              leading_dirs_consider=["crcns.*", "1"],
              leading_dirs_depth=2,
              use_current_dir=False,
              exclude=".*__MACOSX.*",
          )  # some junk penetrates
  
          eq_(
              repo.get_description(
                  uuid=DATALAD_SPECIAL_REMOTES_UUIDS[
                      ARCHIVES_SPECIAL_REMOTE
                  ]
              ),
              "[%s]" % ARCHIVES_SPECIAL_REMOTE,
          )
  
          all_files = sorted(find_files("."))
          # posixify paths to make it work on Windows as well
          all_files = [Path(file).as_posix() for file in all_files]
          target_files = {
              "CR24A/behaving1/1 f.txt",
              "CR24C/behaving3/3 f.txt",
              "CR24D/behaving2/2 f.txt",
              ".datalad/config",
          }
          eq_(set(all_files), target_files)
  
          # regression test: the subdir in MACOSX wasn't excluded and its name was
          # getting stripped by leading_dir_len
          # if stripping and exclude didn't work this fails
          assert_false(exists("__MACOSX"))
          # if exclude doesn't work then name of subdir gets stripped by
          # leading_dir_len
          assert_false(exists("c-1_data"))
          # if exclude doesn't work but everything else works this fails
          assert_false(exists("CR24B"))
  
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 1 for calling a global function with example usage: test_add_archive_dirs(path_orig, url, repo_path) without return types