code: def get_datasets_for_view_names(
      group: dict,
      vl_chart_names: List[str],
      facet_mapping: FacetMapping,
      scope: Scope = (),
  ) -> Dict[str, Tuple[str, Scope]]:
      """Get the Vega datasets that correspond to the provided Altair view names
  
      Parameters
      ----------
      group : dict
          Top-level Vega spec or nested group mark
      vl_chart_names : list of str
          List of the Vega-Lite
      facet_mapping : dict from (str, tuple of int) to (str, tuple of int)
          The facet mapping produced by get_facet_mapping
      scope : tuple of int
          Scope of the group dictionary within a top-level Vega spec
  
      Returns
      -------
      dict from str to (str, tuple of int)
          Dict from Altair view names to scoped datasets
      """
      datasets = {}
      group_index = 0
      mark_group = get_group_mark_for_scope(group, scope) or {}
      for mark in mark_group.get("marks", []):
          for vl_chart_name in vl_chart_names:
              if mark.get("name", "") == f"{vl_chart_name}_cell":
                  data_name = (
                      mark.get("from", {})
                      .get("facet", None)
                      .get("data", None)
                  )
                  scoped_data_name = (data_name, scope)
                  datasets[vl_chart_name] = get_from_facet_mapping(
                      scoped_data_name, facet_mapping
                  )
                  break
  
          name = mark.get("name", "")
          if mark.get("type", "") == "group":
              group_data_names = get_datasets_for_view_names(
                  group,
                  vl_chart_names,
                  facet_mapping,
                  scope=scope + (group_index,),
              )
              for k, v in group_data_names.items():
                  datasets.setdefault(k, v)
              group_index += 1
          else:
              for vl_chart_name in vl_chart_names:
                  if name.startswith(vl_chart_name) and name.endswith(
                      "_marks"
                  ):
                      data_name = mark.get("from", {}).get("data", None)
                      scoped_data = (
                          get_definition_scope_for_data_reference(
                              group, data_name, scope
                          )
                      )
                      if scoped_data is not None:
                          datasets[
                              vl_chart_name
                          ] = get_from_facet_mapping(
                              (data_name, scoped_data), facet_mapping
                          )
                          break
  
      return datasets
  
file_path: altair/altair/utils/_transformed_data.py
imports: from typing import List, Optional, Tuple, Dict, Iterable, overload, Union
  from altair import Chart, FacetChart, LayerChart, HConcatChart, VConcatChart, ConcatChart, TopLevelUnitSpec, FacetedUnitSpec, UnitSpec, UnitSpecWithFrame, NonNormalizedSpec, TopLevelLayerSpec, LayerSpec, TopLevelConcatSpec, ConcatSpecGenericSpec, TopLevelHConcatSpec, HConcatSpecGenericSpec, TopLevelVConcatSpec, VConcatSpecGenericSpec, TopLevelFacetSpec, FacetSpec, data_transformers
  from altair.utils._vegafusion_data import get_inline_tables, import_vegafusion
  from altair.utils.core import DataFrameLike
  from altair.utils.schemapi import Undefined
label_desc: Use image node_id 10 for calling a global function with example usage: get_datasets_for_view_names(group, vl_chart_names, facet_mapping, scope) and returns: datasets