code: def _eig_from_ape(
      model, design, target_labels, ape, eig, prior_entropy_kwargs
  ):
      mean_field = prior_entropy_kwargs.get("mean_field", True)
      if eig:
          if mean_field:
              try:
                  prior_entropy = mean_field_entropy(
                      model, [design], whitelist=target_labels
                  )
              except NotImplemented:
                  prior_entropy = monte_carlo_entropy(
                      model,
                      design,
                      target_labels,
                      **prior_entropy_kwargs,
                  )
          else:
              prior_entropy = monte_carlo_entropy(
                  model, design, target_labels, **prior_entropy_kwargs
              )
          return prior_entropy - ape
      else:
          return ape
  
imports: import math
  import warnings
  import torch
  import pyro
  from pyro import poutine
  from pyro.contrib.oed.search import Search
  from pyro.contrib.util import lexpand
  from pyro.infer import SVI, EmpiricalMarginal, Importance
  from pyro.infer.autoguide.utils import mean_field_entropy
  from pyro.util import torch_isinf, torch_isnan
label_desc: Use image node_id 2 for calling a global function with example usage: _eig_from_ape(model, design, target_labels, ape, eig, prior_entropy_kwargs) and returns: unknown, ape