def discover_modules(self):
modules = [self.package_name]<EOL>for dirpath, dirnames, filenames in os.walk(self.root_path):<EOL><INDENT>root_uri = self._path2uri(os.path.join(self.root_path,<EOL>dirpath))<EOL>filenames = [f[:-<NUM_LIT:3>] for f in filenames if<EOL>f.endswith('<STR_LIT>') and not f.startswith('<STR_LIT>')]<EOL>for filename in filenames:<EOL><INDENT>package_uri = '<STR_LIT:/>'.join((dirpath, filename))<EOL><DEDENT>for subpkg_name in dirnames + filenames:<EOL><INDENT>package_uri = '<STR_LIT:.>'.join((root_uri, subpkg_name))<EOL>package_path = self._uri2path(package_uri)<EOL>if (package_path and<EOL>self._survives_exclude(package_uri, '<STR_LIT>')):<EOL><INDENT>modules.append(package_uri)<EOL><DEDENT><DEDENT><DEDENT>return sorted(modules)<EOL>
Return module sequence discovered from ``self.package_name``


        Parameters
        ----------
        None

        Returns
        -------
        mods : sequence
            Sequence of module names within ``self.package_name``

        Examples
        --------
        >>> dw = ApiDocWriter('sphinx')
        >>> mods = dw.discover_modules()
        >>> 'sphinx.util' in mods
        True
        >>> dw.package_skip_patterns.append('\.util$')
        >>> 'sphinx.util' in dw.discover_modules()
        False
        >>>