code: def get_mapping_for_task(task, framework):
      """Get mappings defined in `XXXPipelineTests` for the task `task`."""
      # Use the cached results
      if PIPELINE_TEST_MAPPING[task].get(framework, None) is not None:
          return PIPELINE_TEST_MAPPING[task][framework]
  
      pipeline_test_class = pipeline_test_mapping[task]["test"]
      mapping = None
  
      if framework == "pt":
          mapping = getattr(pipeline_test_class, "model_mapping", None)
      elif framework == "tf":
          mapping = getattr(
              pipeline_test_class, "tf_model_mapping", None
          )
  
      if mapping is not None:
          mapping = dict(mapping.items())
  
      # cache the results
      PIPELINE_TEST_MAPPING[task][framework] = mapping
      return mapping
  
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 2 for calling a global function with example usage: get_mapping_for_task(task, framework) and returns: mapping, PIPELINE_TEST_MAPPING