code: def tar_extract(context):
      
      logger.debug("start")
  
      mode = get_file_mode_for_reading(context)
  
      for item in context['tar']['extract']:
          # in is the path to the tar to extract. Allows string interpolation.
          source = context.get_formatted_string(item['in'])
          # out is the outdir, dhur. Allows string interpolation.
          destination = context.get_formatted_string(item['out'])
          with tarfile.open(source, mode) as extract_me:
              logger.debug(f"Extracting '{source}' to '{destination}'")
  
              extract_me.extractall(destination)
              logger.info(f"Extracted '{source}' to '{destination}'")
  
      logger.debug("end")
docs: Extract all members of tar archive to specified path.
  
      Args:
          context: dictionary-like. context is mandatory.
              context['tar']['extract'] must exist. It's a dictionary.
              keys are the path to the tar to extract.
              values are the destination paths.
  
      Example:
          tar:
              extract:
                  - in: path/to/my.tar.xs
                    out: /path/extract/here
                  - in: another/tar.xs
                    out: .
  
          This will extract path/to/my.tar.xs to /path/extract/here, and also
          extract another/tar.xs to $PWD.