docstr: Ensure that the wrapped module satisfies required invariants.
  
  Parameters
  ----------
  mod
      Wrapped module to postprocess
  slow_mod
      Slow version that we are mimicking
  fast_mod
      Fast module that provides accelerated implementations (may
      be None
  
  Returns
  -------
  Checked and validated module
  
  Notes
  -----
  The implementation of fast-slow proxies imposes certain
  requirements on the wrapped modules that it delivers. This
  function encodes those requirements and raises if the module
  does not satisfy them.
  
  This post-processing routine should be kept up to date with any
  requirements encoded by fast_slow_proxy.py
docstr_tok: ["Ensure","that","the","wrapped","module","satisfies","required","invariants",".","Parameters","--","--","--","--","--","mod","Wrapped","module","to","postprocess","slow_mod","Slow","version","that","we","are","mimicking","fast_mod","Fast","module","that","provides","accelerated","implementations","(","may","be","None","Returns","--","--","--","-","Checked","and","validated","module","Notes","--","--","-","The","implementation","of","fast-slow","proxies","imposes","certain","requirements","on","the","wrapped","modules","that","it","delivers",".","This","function","encodes","those","requirements","and","raises","if","the","module","does","not","satisfy","them",".","This","post-processing","routine","should","be","kept","up","to","date","with","any","requirements","encoded","by","fast_slow_proxy.py"]
code: def _postprocess_module(
      self,
      mod: ModuleType,
      slow_mod: ModuleType,
      fast_mod: ModuleType | None,
  ) -> ModuleType:
      """Ensure that the wrapped module satisfies required invariants.
  
      Parameters
      ----------
      mod
          Wrapped module to postprocess
      slow_mod
          Slow version that we are mimicking
      fast_mod
          Fast module that provides accelerated implementations (may
          be None
  
      Returns
      -------
      Checked and validated module
  
      Notes
      -----
      The implementation of fast-slow proxies imposes certain
      requirements on the wrapped modules that it delivers. This
      function encodes those requirements and raises if the module
      does not satisfy them.
  
      This post-processing routine should be kept up to date with any
      requirements encoded by fast_slow_proxy.py
      """
      mod.__dict__["_fsproxy_slow"] = slow_mod
      if fast_mod is not None:
          mod.__dict__["_fsproxy_fast"] = fast_mod
      return mod
  
imports: from __future__ import annotations
  import contextlib
  import functools
  import importlib
  import importlib.abc
  import importlib.machinery
  import os
  import pathlib
  import sys
  import threading
  import warnings
  from abc import abstractmethod
  from importlib._bootstrap import _ImportLockContext
  from types import ModuleType
  from typing import Any, ContextManager, Dict, List, NamedTuple
  from typing_extensions import Self
  from .fast_slow_proxy import _FunctionProxy, _is_function_or_method, _Unusable, get_final_type_map, get_intermediate_type_map, get_registered_functions
label_desc: Use image node_id 7 for calling the ModuleAcceleratorBase obj's underlying member method code with example usage: obj._postprocess_module(mod, slow_mod, fast_mod) and returns: mod