def _module_exists(self, module_name):
        """
        Returns True iff module_name exists (but isn't necessarily importable).
        """

        # imp.find_module doesn't handle hierarchical module names, so we split
        # on full stops and keep feeding it the path it returns until we run
        # out of module name.

        module_name, path = module_name.split('.'), None
        while module_name:
            try:
                path = [imp.find_module(module_name.pop(0), path)[1]]
            except __HOLE__, e:
                return False
        return True
dataset/ETHPy150Open mollyproject/mollyproject/molly/conf/settings.py/Application._module_exists