<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _include_module(self, module, mn):
 """ See if a module should be included or excluded based upon included_packages and excluded_packages. As some packages have the following format: scipy.special.specfun scipy.linalg Where the top-level package name is just a prefix to a longer package name, we don't want to do a direct comparison. Instead, we want to exclude packages which are either exactly "<package_name>", or start with "<package_name>". """


        if mn in self.topology.include_packages:
            _debug.debug("_include_module:explicit using __include_packages: module=%s", mn)
            return True
        if '.' in mn:
            for include_package in self.topology.include_packages:
                if mn.startswith(include_package + '.'):
                    _debug.debug("_include_module:explicit pattern using __include_packages: module=%s pattern=%s", mn, \
                            include_package + '.')
                    return True

        if mn in self.topology.exclude_packages:
            _debug.debug("_include_module:explicit using __exclude_packages: module=%s", mn)
            return False
        if '.' in mn:
            for exclude_package in self.topology.exclude_packages:
                if mn.startswith(exclude_package + '.'):
                    _debug.debug("_include_module:explicit pattern using __exclude_packages: module=%s pattern=%s", mn, \
                                 exclude_package + '.')
                    return False

        _debug.debug("_include_module:including: module=%s", mn)
        return True