code: def eval_facet_vars(
      data: pd.DataFrame, vars: list[str], env: Environment
  ) -> pd.DataFrame:
      """
      Evaluate facet variables
  
      Parameters
      ----------
      data :
          Factet dataframe
      vars :
          Facet variables
      env :
          Plot environment
  
      Returns
      -------
      :
          Facet values that correspond to the specified
          variables.
      """
  
      # To allow expressions in facet formula
      def I(value: Any) -> Any:
          return value
  
      env = env.with_outer_namespace({"I": I})
      facet_vals = pd.DataFrame(index=data.index)
  
      for name in vars:
          if name in data:
              # This is a limited solution. If a keyword is
              # part of an expression it will fail in the
              # else statement below
              res = data[name]
          elif str.isidentifier(name):
              # All other non-statements
              continue
          else:
              # Statements
              try:
                  res = env.eval(name, inner_namespace=data)
              except NameError:
                  continue
          facet_vals[name] = res
  
      return facet_vals
  
imports: from __future__ import annotations
  import itertools
  import types
  import typing
  from copy import copy, deepcopy
  import numpy
  import pandas
  import pandas.api.types
  from .._utils import cross_join, match
  from ..exceptions import PlotnineError
  from ..scales.scales import Scales
  from .strips import Strips
label_desc: Use image node_id 5 for calling a global function with example usage: eval_facet_vars(data, vars, env) and returns: facet_vals, value