code: def get_policy(cls: type[hk.Module]) -> Optional[jmp.Policy]:
      """Retrieves the currently active policy for the given class.
  
      Note that policies applied explicitly to a top level class (e.g. ``ResNet``)
      will be applied implicitly to all child modules (e.g. ``ConvND``) called from
      the parent. This function only returns policies that have been applied
      explicitly (e.g. via :func:`set_policy`).
  
      Args:
        cls: A Haiku module class.
  
      Returns:
        A JMP policy that is used for the given class, or ``None`` if one is not
        active.
  
      See also:
        - :func:`current_policy`: Retrieves the currently active policy (if any).
        - :func:`clear_policy`: Clears any policies associated with a class.
        - :func:`set_policy`: Sets a policy for a given class.
        - :func:`push_policy`: Context manager for setting policies.
      """
      return _thread_local_state.get_policy(cls)
  
imports: import collections
  import contextlib
  import threading
  from typing import TypeVar, Optional, Union
  from haiku._src import base
  from haiku._src import data_structures
  from haiku._src import module
  import jmp
label_desc: Use image node_id 4 for calling a global function with example usage: get_policy(cls) and returns: _thread_local_state