code: def get_model_for_pipeline_test(test_class, task):
      """Get the model architecture(s) related to the test class `test_class` for a pipeline `task`."""
      framework = get_framework(test_class)
      if framework is None:
          return None
      mapping = get_mapping_for_task(task, framework)
      if mapping is None:
          return None
  
      config_classes = list(
          {
              model_class.config_class
              for model_class in test_class.all_model_classes
          }
      )
      if len(config_classes) != 1:
          raise ValueError(
              "There should be exactly one configuration class from `test_class.all_model_classes`."
          )
  
      # This could be a list/tuple of model classes, but it's rare.
      model_class = mapping.get(config_classes[0], None)
      if isinstance(model_class, (tuple, list)):
          model_class = sorted(model_class, key=lambda x: x.__name__)
  
      return model_class
  
file_path: transformers/utils/add_pipeline_model_mapping_to_test.py
imports: import argparse
  import glob
  import inspect
  import os
  import re
  import unittest
  from get_test_info import get_test_classes
  from tests.test_pipeline_mixin import pipeline_test_mapping
label_desc: Use image node_id 3 for calling a global function with example usage: get_model_for_pipeline_test(test_class, task) and returns: model_class, None, None