class_docstr: Container for the extracted archive
      
class_docstr_tok: ["Container","for","the","extracted","archive"]
code: def _extract_archive(self, path):
      # we need to extract the archive
      # TODO: extract to _tmp and then move in a single command so we
      # don't end up picking up broken pieces
      lgr.debug("Extracting %s under %s", self._archive, path)
      if exists(path):
          lgr.debug(
              "Previous extracted (but probably not fully) cached archive "
              "found. Removing %s",
              path,
          )
          rmtree(path)
      os.makedirs(path)
      assert exists(path)
      # remove old stamp
      if exists(self.stamp_path):
          rmtree(self.stamp_path)
      decompress_file(self._archive, path, leading_directories=None)
      # TODO: must optional since we might to use this content, move it
      # into the tree etc
      # lgr.debug("Adjusting permissions to R/O for the extracted content")
      # rotree(path)
      assert exists(path)
      # create a stamp
      with open(self.stamp_path, "wb") as f:
          f.write(ensure_bytes(self._archive))
      # assert that stamp mtime is not older than archive's directory
      assert self.is_extracted
  
imports: import hashlib
  import logging
  import os
  import random
  import string
  import tempfile
  from datalad import cfg
  from datalad.config import anything2bool
  from datalad.consts import ARCHIVES_TEMP_DIR
  from datalad.support.external_versions import external_versions
  from datalad.support.locking import lock_if_check_fails
  from datalad.support.path import abspath, exists, isabs, isdir
  from datalad.support.path import join
  from datalad.support.path import normpath, pardir, relpath
  from datalad.support.path import sep
  from datalad.utils import Path, any_re_search, ensure_bytes, ensure_unicode, get_tempfile_kwargs, on_windows, rmtemp, rmtree, unlink
label_desc: Use image node_id 8 for calling the ExtractedArchive obj's underlying member method code with example usage: obj._extract_archive(path) without return types