code: def get_pipeline_model_mapping_string(test_class):
      """Get `pipeline_model_mapping` for `test_class` as a string (to be added to the test file).
  
      This will be a 1-line string. After this is added to a test file, `make style` will format it beautifully.
      """
      framework = get_framework(test_class)
      if framework == "pt":
          framework = "torch"
      default_value = "{}"
  
      mapping = get_pipeline_model_mapping(test_class)
      if len(mapping) == 0:
          return ""
  
      texts = []
      for task, model_classes in mapping.items():
          if isinstance(model_classes, (tuple, list)):
              # A list/tuple of model classes
              value = (
                  "("
                  + ", ".join([x.__name__ for x in model_classes])
                  + ")"
              )
          else:
              # A single model class
              value = model_classes.__name__
          texts.append(f'"{task}": {value}')
      text = "{" + ", ".join(texts) + "}"
      text = f"pipeline_model_mapping = {text} if is_{framework}_available() else {default_value}"
  
      return text
  
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 5 for calling a global function with example usage: get_pipeline_model_mapping_string(test_class) and returns: text, str