code: def test_save_all_adapters_with_head(self):
      if self.config_class not in ADAPTER_MODEL_MAPPING:
          self.skipTest("Does not support flex heads.")
  
      model = AutoAdapterModel.from_config(self.config())
      model.eval()
      model.add_adapter("test")
      self.add_head(model, "test")
      with tempfile.TemporaryDirectory() as tmp_dir:
          model.save_all_adapters(tmp_dir, with_head=True)
          self.assertTrue(
              os.path.isfile(
                  os.path.join(tmp_dir, "test", "head_config.json")
              )
          )
  
      with tempfile.TemporaryDirectory() as tmp_dir:
          model.save_all_adapters(tmp_dir, with_head=False)
          self.assertFalse(
              os.path.isfile(
                  os.path.join(tmp_dir, "test", "head_config.json")
              )
          )
  
imports: import os
  import tempfile
  import torch
  import adapters
  from adapters import ADAPTER_MODEL_MAPPING, AdapterSetup, AutoAdapterModel
  from adapters.composition import BatchSplit, Stack
  from transformers import AutoModelForSequenceClassification
  from transformers.testing_utils import require_torch, torch_device
  from .methods import create_twin_models
label_desc: Use image node_id 21 for calling the PredictionHeadModelTestMixin obj's underlying member method code with example usage: obj.test_save_all_adapters_with_head() without return types