code: def cached_eval(config, expr, d):
      if not hasattr(config, "_evalcache"):
          config._evalcache = {}
      try:
          return config._evalcache[expr]
      except KeyError:
          import _pytest._code
  
          exprcode = _pytest._code.compile(expr, mode="eval")
          config._evalcache[expr] = x = eval(exprcode, d)
          return x
  
imports: import os
  import platform
  import sys
  import traceback
  import six
  from ..outcomes import fail
  from ..outcomes import TEST_OUTCOME
label_desc: Use image node_id 1 for calling a global function with example usage: cached_eval(config, expr, d) and returns: config, x