docstr: Unpack tar.gz bundle
docstr_tok: ["Unpack","tar.gz","bundle"]
code: def _unpack_src(self):
      """Unpack tar.gz bundle"""
      # cleanup
      if os.path.isdir(self.build_dir):
          shutil.rmtree(self.build_dir)
      os.makedirs(self.build_dir)
  
      tf = tarfile.open(self.src_file)
      name = self.build_template.format(self.version)
      base = name + "/"
      # force extraction into build dir
      members = tf.getmembers()
      for member in list(members):
          if member.name == name:
              members.remove(member)
          elif not member.name.startswith(base):
              raise ValueError(member.name, base)
          member.name = member.name[len(base) :].lstrip("/")
      log.info("Unpacking files to {}".format(self.build_dir))
      tf.extractall(self.build_dir, members)
  
imports: from __future__ import print_function
  import argparse
  from datetime import datetime
  import logging
  import os
  import re
  import shutil
  import subprocess
  import sys
  import tarfile
label_desc: Use image node_id 16 for calling the AbstractBuilder obj's underlying member method code with example usage: obj._unpack_src() without return types