code: def add_route(self, router, index=None):
          '''Add a new :class:`Router` to the :attr:`routes` list.
          '''
          assert isinstance(router, Router), 'Not a valid Router'
          assert router is not self, 'cannot add self to children'
  
          for r in self.routes:
              if r == router:
                  return r
              elif r._route == router._route:
                  raise ValueError('Cannot add route %s. Already avalable' %
                                   r._route)
          #
          # Remove from previous parent
          if router.parent:
              router.parent.remove_child(router)
          router._parent = self
          if index is None:
              self.routes.append(router)
          else:
              self.routes.insert(index, router)
          return routef add_route(self, router, index=None):
          '''Add a new :class:`Router` to the :attr:`routes` list.
          '''
          assert isinstance(router, Router), 'Not a valid Router'
          assert router is not self, 'cannot add self to children'
  
          for r in self.routes:
              if r == router:
                  return r
              elif r._route == router._route:
                  raise ValueError('Cannot add route %s. Already avalable' %
                                   r._route)
          #
          # Remove from previous parent
          if router.parent:
              router.parent.remove_child(router)
          router._parent = self
          if index is None:
              self.routes.append(router)
          else:
              self.routes.insert(index, router)
          return router
docs: Add a new :class:`Router` to the :attr:`routes` list.