code: def _state_partial_eval_custom(prim, saveable, unks_in, inst_in, eqn):
      if any(unks_in):
          res = [v for v, inst in zip(eqn.invars, inst_in) if not inst]
          return (
              None,
              eqn,
              [True] * len(eqn.outvars),
              [True] * len(eqn.outvars),
              res,
          )
      elif saveable(
          prim, *[var.aval for var in eqn.invars], **eqn.params
      ):
          return (
              eqn,
              None,
              [False] * len(eqn.outvars),
              [False] * len(eqn.outvars),
              [],
          )
      res = [v for v, inst in zip(eqn.invars, inst_in) if not inst]
      return (
          eqn,
          eqn,
          [False] * len(eqn.outvars),
          [True] * len(eqn.outvars),
          res,
      )
  
imports: from __future__ import annotations
  from functools import partial
  from typing import Any, Union
  import numpy
  from jax._src import ad_util
  from jax._src import core
  from jax._src import pretty_printer
  from jax._src import tree_util
  from jax._src.interpreters import ad
  from jax._src.interpreters import batching
  from jax._src.interpreters import partial_eval
  from jax._src.interpreters import mlir
  from jax._src.lax import lax
  from jax._src.typing import Array
  from jax._src.state import indexing
  from jax._src.state.types import AbstractRef, RefView, ReadEffect, WriteEffect, AccumEffect
  from jax._src.util import safe_map, safe_zip
label_desc: Use image node_id 27 for calling a global function with example usage: _state_partial_eval_custom(prim, saveable, unks_in, inst_in, eqn) and returns: eqn,  eqn,  unknown,  unknown,  res, None,  eqn,  unknown,  unknown,  res, eqn,  None,  unknown,  unknown,  list