docstr: Return the wrapped version of an attribute.
  
  Parameters
  ----------
  slow_attr : Any
      The attribute from the slow module
  fast_mod : Any (or None)
      The same attribute from the fast module, if it exists
  name
      Name of attribute
  
  Returns
  -------
  Wrapped attribute
docstr_tok: ["Return","the","wrapped","version","of","an","attribute",".","Parameters","--","--","--","--","--","slow_attr",":","Any","The","attribute","from","the","slow","module","fast_mod",":","Any","(","or","None",")","The","same","attribute","from","the","fast","module",",","if","it","exists","name","Name","of","attribute","Returns","--","--","--","-","Wrapped","attribute"]
code: def _wrap_attribute(
      self,
      slow_attr: Any,
      fast_attr: Any | _Unusable,
      name: str,
  ) -> Any:
      """
      Return the wrapped version of an attribute.
  
      Parameters
      ----------
      slow_attr : Any
          The attribute from the slow module
      fast_mod : Any (or None)
          The same attribute from the fast module, if it exists
      name
          Name of attribute
  
      Returns
      -------
      Wrapped attribute
      """
      wrapped_attr: Any
      # TODO: what else should we make sure not to get from the fast
      # library?
      if name in {"__all__", "__dir__", "__file__", "__doc__"}:
          wrapped_attr = slow_attr
      elif self.fast_lib == self.slow_lib:
          # no need to create a fast-slow wrapper
          wrapped_attr = slow_attr
      if any(
          [
              slow_attr in get_registered_functions(),
              slow_attr in get_final_type_map(),
              slow_attr in get_intermediate_type_map(),
          ]
      ):
          # attribute already registered in self._wrapped_objs
          return self._wrapped_objs[slow_attr]
      if isinstance(
          slow_attr, ModuleType
      ) and slow_attr.__name__.startswith(self.slow_lib):
          # attribute is a submodule of the slow library,
          # replace the string "{slow_lib}" in the submodule's
          # name with "{self.mod_name}"
          # now, attempt to import the wrapped module, which will
          # recursively wrap all of its attributes:
          return importlib.import_module(
              rename_root_module(
                  slow_attr.__name__, self.slow_lib, self.mod_name
              )
          )
      if slow_attr in self._wrapped_objs:
          if type(fast_attr) is _Unusable:
              # we don't want to replace a wrapped object that
              # has a usable fast object with a wrapped object
              # with a an unusable fast object.
              return self._wrapped_objs[slow_attr]
      if _is_function_or_method(slow_attr):
          wrapped_attr = _FunctionProxy(fast_attr, slow_attr)
      else:
          wrapped_attr = slow_attr
      return wrapped_attr
  
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 9 for calling the ModuleAcceleratorBase obj's underlying member method code with example usage: obj._wrap_attribute(slow_attr, fast_attr, name) and returns: wrapped_attr, self, importlib, self