code: def get_mark_group_for_scope(vega_spec, scope):
      group = vega_spec
  
      # Find group at scope
      for scope_value in scope:
          group_index = 0
          child_group = None
          for mark in group.get("marks", []):
              if mark.get("type") == "group":
                  if group_index == scope_value:
                      child_group = mark
                      break
                  group_index += 1
          if child_group is None:
              return None
          group = child_group
  
      return group
  
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 7 for calling a global function with example usage: get_mark_group_for_scope(vega_spec, scope) and returns: group, None