code: def retrieve_model_classes(
      model_type: str, frameworks: Optional[List[str]] = None
  ) -> Dict[str, List[str]]:
      """
      Retrieve the model classes associated to a given model.
  
      Args:
          model_type (`str`): A valid model type (like "bert" or "gpt2")
          frameworks (`List[str]`, *optional*):
              The frameworks to look for. Will default to `["pt", "tf", "flax"]`, passing a smaller list will restrict
              the classes returned.
  
      Returns:
          `Dict[str, List[str]]`: A dictionary with one key per framework and the list of model classes associated to
          that framework as values.
      """
      if frameworks is None:
          frameworks = get_default_frameworks()
  
      modules = {
          "pt": auto_module.modeling_auto
          if is_torch_available()
          else None,
          "tf": auto_module.modeling_tf_auto
          if is_tf_available()
          else None,
          "flax": auto_module.modeling_flax_auto
          if is_flax_available()
          else None,
      }
  
      model_classes = {}
      for framework in frameworks:
          new_model_classes = []
          if modules[framework] is None:
              raise ValueError(
                  f"You selected {framework} in the frameworks, but it is not installed."
              )
          model_mappings = [
              attr
              for attr in dir(modules[framework])
              if _re_model_mapping.search(attr) is not None
          ]
          for model_mapping_name in model_mappings:
              model_mapping = getattr(
                  modules[framework], model_mapping_name
              )
              if model_type in model_mapping:
                  new_model_classes.append(model_mapping[model_type])
  
          if len(new_model_classes) > 0:
              # Remove duplicates
              model_classes[framework] = list(set(new_model_classes))
  
      return model_classes
  
imports: import difflib
  import json
  import os
  import re
  from argparse import ArgumentParser, Namespace
  from dataclasses import dataclass
  from datetime import date
  from itertools import chain
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Optional, Pattern, Tuple, Union
  import transformers.models.auto
  from transformers.models.auto.configuration_auto import model_type_to_module_name
  from ..utils import is_flax_available, is_tf_available, is_torch_available, logging
  from .None import BaseTransformersCLICommand
label_desc: Use image node_id 14 for calling a global function with example usage: retrieve_model_classes(model_type, frameworks) and returns: model_classes