class_docstr: Class for mocking deprecated modules.
  
  Parameters
  ----------
  deprmod : name of module to be deprecated.
  deprmodto : name of module as a replacement, optional.
              If not given, the __module__ attribute will
              be used when needed.
  removals : objects or methods in module that will no longer be
             accessible once module is removed.
  moved : dict, optional
          dictionary of function name -> new location for moved
          objects
code: def __getattr__(self, name):
      if name in self.self_dir:
          return object.__getattribute__(self, name)
  
      try:
          deprmodule = self._import_deprmod(self.deprmod)
      except ImportError:
          if self.deprmodto is None:
              raise
  
          # a rename
          deprmodule = self._import_deprmod(self.deprmodto)
  
      obj = getattr(deprmodule, name)
  
      if self.removals is not None and name in self.removals:
          warnings.warn(
              "{deprmod}.{name} is deprecated and will be removed in "
              "a future version.".format(
                  deprmod=self.deprmod, name=name
              ),
              FutureWarning,
              stacklevel=2,
          )
      elif self.moved is not None and name in self.moved:
          warnings.warn(
              "{deprmod} is deprecated and will be removed in "
              "a future version.\nYou can access {name} as {moved}".format(
                  deprmod=self.deprmod,
                  name=name,
                  moved=self.moved[name],
              ),
              FutureWarning,
              stacklevel=2,
          )
      else:
          deprmodto = self.deprmodto
          if deprmodto is False:
              warnings.warn(
                  "{deprmod}.{name} is deprecated and will be removed in "
                  "a future version.".format(
                      deprmod=self.deprmod, name=name
                  ),
                  FutureWarning,
                  stacklevel=2,
              )
          else:
              if deprmodto is None:
                  deprmodto = obj.__module__
              # The object is actually located in another module.
              warnings.warn(
                  "{deprmod}.{name} is deprecated. Please use "
                  "{deprmodto}.{name} instead.".format(
                      deprmod=self.deprmod,
                      name=name,
                      deprmodto=deprmodto,
                  ),
                  FutureWarning,
                  stacklevel=2,
              )
  
      return obj
  
file_path: catboost/contrib/python/pandas/py2/pandas/util/_depr_module.py
imports: import importlib
  import warnings
label_desc: Use image node_id 4 for calling the _DeprecatedModule obj's underlying member method code with example usage: obj.__getattr__(name) and returns: obj, object