def add(self, rule, module):
        """
        Add a Module to this Module under the given rule. All rules within the
        sub-module will be accessible to this Module, with their rules prefixed
        by the rule provided here.

        For example::

            module_one = Module()

            @module_one.route("/fish")
            def fish(request):
                return "This is fish."

            module_two = Module()

            module_two.add("/pie", module_one)

        Given that code, the request handler ``fish`` would be available from
        the Module ``module_two`` with the rules ``/pie/fish``.
        """
        if isinstance(module, Application):
            raise TypeError("Applications cannot be added as modules.")

        # Register this module with the child module.
        module._parents.add(self)

        if not '/' in rule:
            rule = '/' + rule
        self._modules[rule] = module

        # Now, recalculate.
        self._recalculate_routes()
dataset/ETHPy150Open ecdavis/pants/pants/web/application.py/Module.add/original