code: def get_datasets_for_scope(vega_spec, scope):
      group = get_mark_group_for_scope(vega_spec, scope) or {}
  
      # get datasets from group
      datasets = []
      for dataset in group.get("data", []):
          datasets.append(dataset["name"])
  
      # Add facet dataset
      facet_dataset = (
          group.get("from", {}).get("facet", {}).get("name", None)
      )
      if facet_dataset:
          datasets.append(facet_dataset)
      return datasets
  
file_path: vegafusion/python/vegafusion/vegafusion/evaluation.py
imports: from altair import data_transformers, Chart, FacetChart, LayerChart, HConcatChart, VConcatChart, ConcatChart
  from altair.utils.schemapi import Undefined
label_desc: Use image node_id 8 for calling a global function with example usage: get_datasets_for_scope(vega_spec, scope) and returns: datasets