code: def imported_from_bootstrap(self, module):
      
  
      # A vendored module.
      path = getattr(module, '__file__', None)
      if path and os.path.realpath(path).startswith(self._realpath):
        return True
  
      # A vendored package.
      path = getattr(module, '__path__', None)
      if path and any(os.path.realpath(path_item).startswith(self._realpath)
                      for path_item in path):
        return True
  
      return False
docs: Return ``True`` if the given ``module`` object was imported from bootstrap code.
  
      :param module: The module to check the provenance of.
      :type module: :class:`types.ModuleType`
      :rtype: bool