code: def temporary_internal_state(
      state: InternalState, *, share_python_state=False
  ):
      """Pushes a temporary copy of the internal state."""
      state = copy_structure(state)
      rng = state.rng
      if rng is not None:
          rng = base.PRNGSequence(rng)
      current_state = internal_state()
      params = state.params
      if params is None:
          params = current_state.params
      state = state.state
      if state is None:
          state = current_state.state
      frame = base.current_frame()
      frame = frame.evolve(
          params=params,
          state=state,
          rng=rng,
          decoupled=(not share_python_state),
      )
      return base.frame_stack(frame)
  
imports: import collections
  import collections.abc
  from collections.abc import Mapping, MutableMapping
  import functools
  import inspect
  from typing import Any, Callable, Optional, TypeVar
  from haiku._src import base
  import jax
  import jax.numpy
label_desc: Use image node_id 5 for calling a global function with example usage: temporary_internal_state(state) and returns: base