code: def three_var_groups(request, three_var_model):
      kw, grouping = request.param
      approxes, groups = zip(*grouping.items())
      groups, gkwargs = zip(*groups)
      groups = [
          list(map(ft.partial(getattr, three_var_model), g))
          if g is not None
          else None
          for g in groups
      ]
      inited_groups = [
          a(group=g, model=three_var_model, **gk)
          for a, g, gk in zip(approxes, groups, gkwargs)
      ]
      return inited_groups
  
imports: import functools
  import numpy
  import pytensor.tensor
  import pytest
  import pymc
  from pymc.variational import opvi
  from pymc.variational.approximations import Empirical, EmpiricalGroup, FullRank, FullRankGroup, MeanField, MeanFieldGroup
  from tests.helpers import not_raises
label_desc: Use image node_id 7 for calling a global function with example usage: three_var_groups(request, three_var_model) and returns: inited_groups