code: def _make_deprecated_swig_class(deprecated_name, base_name):
      """
      Dynamically construct deprecated classes as wrappers around renamed ones
  
      The deprecation warning added in their __new__-method will trigger upon
      construction of an instance of the class, but only once per session.
  
      We do this here (in __init__.py) because the base classes are defined in
      the SWIG interface, making it cumbersome to add the deprecation there.
  
      Parameters
      ----------
      deprecated_name : string
          Name of the class to be deprecated; _not_ present in SWIG interface.
      base_name : string
          Name of the class that is replacing deprecated_name; must already be
          imported into the current namespace.
  
      Returns
      -------
      None
          However, the deprecated class gets added to the faiss namespace
      """
      base_class = globals()[base_name]
  
      def new_meth(cls, *args, **kwargs):
          msg = f"The class faiss.{deprecated_name} is deprecated in favour of faiss.{base_name}!"
          warnings.warn(msg, DeprecationWarning, stacklevel=2)
          instance = super(base_class, cls).__new__(
              cls, *args, **kwargs
          )
          return instance
  
      # three-argument version of "type" uses (name, tuple-of-bases, dict-of-attributes)
      klazz = type(
          deprecated_name, (base_class,), {"__new__": new_meth}
      )
  
      # this ends up adding the class to the "faiss" namespace, in a way that it
      # is available both through "import faiss" and "from faiss import *"
      globals()[deprecated_name] = klazz
  
file_path: faiss/faiss/python/array_conversions.py
imports: import numpy
  import array
  import warnings
  from faiss.loader import *
label_desc: Use image node_id 1 for calling a global function with example usage: _make_deprecated_swig_class(deprecated_name, base_name) and returns: instance