docs: def extract_archive(archive, solver, put_inside = False):
      """
          Unzips/untars a previously downloaded archive file.
      """
  
      print('extracting {0}'.format(archive))
      root = os.path.join('solvers', solver if put_inside else '')
  
      if archive.endswith('.tar.gz'):
          if os.path.exists(archive[:-7]):
              shutil.rmtree(archive[:-7])
  
          tfile = tarfile.open(archive, 'r:gz')
          tfile.extractall(root)
  
          # normally, directory should be the first name
          # but glucose4.1 has some garbage in the archive
          for name in tfile.getnames():
              if not name.startswith('./.'):
                  directory = name
                  break
      elif archive.endswith('.zip'):
          if os.path.exists(archive[:-4]):
              shutil.rmtree(archive[:-4])
  
          myzip = zipfile.ZipFile(archive, 'r')
          myzip.extractall(root)
          directory = myzip.namelist()[0]
          directory = directory.rstrip('/').split('/')[0]
          myzip.close()
  
      if not put_inside:
          if os.path.exists(os.path.join('solvers', solver)):
              shutil.rmtree(os.path.join('solvers', solver))
  
          shutil.move(os.path.join('solvers', directory), os.path.join('solvers', solver))