def write_doc_submodule(self, filename, title=None,
                    header=None, submodulename=None):
        outfile = file(os.sep.join([self.out_dir, filename]), 'w')

        if header is not None:
            outfile.write(header)

        outfile.write('''

.. currentmodule:: %s

.. note::

    This section is only a reference describing the function, please see
    the chapter on :ref:`simple-scripting-with-mlab` for an introduction to
    mlab and how to interact with and assemble the functions of `mlab`.

    Please see the section on :ref:`running-mlab-scripts` for
    instructions on running the examples.

''' % self.module.__name__ )
        if title is not None:
            outfile.write(title + '\n')
            outfile.write('='*len(title) + '\n')

        documented = set()

        for func_name in sorted(self.to_document):
            func = getattr(self.module, func_name)

            if (    submodulename is not None
                    and not func.__module__ == submodulename ):
                continue

            outfile.write(self.document_function(func_name))
            outfile.write("\n\n")
            documented.add(func_name)

        self.to_document.difference_update(documented)


#############################################################################
# Entry point
Solves design matrix for approximating to basis functions
dataset/ETHPy150Open enthought/mayavi/mlab_reference.py/ModuleReference.write_doc_submodule--crossover with--dataset/ETHPy150Open sunlightlabs/clearspending/completeness/statlib/matfunc.py/funfit