code: def select_frameworks_to_install(
      include_frameworks: Union[List[str], str],
      include_backends: Union[List[str], str],
  ) -> List[str]:
      supported_frameworks = list(INSTALLERS.keys())
      if (
          isinstance(include_frameworks, str)
          and include_frameworks == "all"
      ):
          frameworks_list = supported_frameworks
      elif isinstance(include_frameworks, list):
          frameworks_list = []
          for framework in include_frameworks:
              if framework in supported_frameworks:
                  frameworks_list.append(framework)
              else:
                  logger.warning(f"Framework {framework} not supported")
  
          if len(frameworks_list) == 0:
              raise ValueError("No supported frameworks selected")
  
          if (
              isinstance(include_backends, str)
              and include_backends == "all"
          ):
              for framework in frameworks_list:
                  for backend in SUPPORTED_BACKENDS_DICT[framework]:
                      frameworks_list.append(backend)
          elif isinstance(include_backends, list):
              for backend in include_backends:
                  if backend not in supported_frameworks:
                      logger.warning(f"Backend {backend} not supported")
                  else:
                      backend_supported = False
                      for framework in frameworks_list:
                          if (
                              backend
                              in SUPPORTED_BACKENDS_DICT[framework]
                          ):
                              frameworks_list.append(backend)
                              backend_supported = True
                              break
                      if not backend_supported:
                          logger.warning(
                              f"Backend {backend} not supported for selected "
                              f"frameworks"
                          )
          else:
              raise ValueError("Invalid backends list")
      else:
          raise ValueError("Invalid frameworks list")
  
      frameworks_list = list(set(frameworks_list))
      frameworks_list.sort()
  
      return frameworks_list
  
file_path: nebuly/optimization/nebullvm/nebullvm/installers/auto_installer.py
imports: import argparse
  from typing import List, Union
  from loguru import logger
  from nebullvm.config import ONNX_MODULES, TENSORFLOW_MODULES, TORCH_MODULES, HUGGING_FACE_MODULES, DIFFUSERS_MODULES
  from nebullvm.installers.installers import ONNXInstaller, PytorchInstaller, TensorflowInstaller, HuggingFaceInstaller, DiffusersInstaller
label_desc: Use image node_id 1 for calling a global function with example usage: select_frameworks_to_install(include_frameworks, include_backends) and returns: frameworks_list