Build a URL path fragment for a resource or route.

        Possible values for `target`:

        A string that does not start with a '.' and does not contain ':'.
          : Looks up the route of the same name on this mapper and returns it's
            path.

        A string of the form 'a:b', 'a:b:c', etc.
          : Follows the route to nested mappers by splitting off consecutive
            segments. Returns the path of the route found by looking up the
            final segment on the last mapper.

        A `Route` object
          : Returns the path for the route.

        A resource that was added previously
          : Looks up the first route that points to this resource and
            returns its path.

def path(self, target, args, kw):
        """Build a URL path fragment for a resource or route.

        Possible values for `target`:

        A string that does not start with a '.' and does not contain ':'.
          : Looks up the route of the same name on this mapper and returns it's
            path.

        A string of the form 'a:b', 'a:b:c', etc.
          : Follows the route to nested mappers by splitting off consecutive
            segments. Returns the path of the route found by looking up the
            final segment on the last mapper.

        A `Route` object
          : Returns the path for the route.

        A resource that was added previously
          : Looks up the first route that points to this resource and
            returns its path.
        """
        if type(target) in string_types:
            if ':' in target:
                # Build path a nested route name
                prefix, rest = target.split(':', 1)
                route = self.named_routes[prefix]
                prefix_params = route._pop_params(args, kw)
                prefix_path = route.path([], prefix_params)
                next_mapper = route.resource
                return prefix_path + next_mapper.path(rest, args, kw)
            else:
                # Build path for a named route
                return self.named_routes[target].path(args, kw)
        elif isinstance(target, Route):
            # Build path for a route instance, used by build_url('.')
            for route in self.routes:
                if route is target:
                    return route.path(args, kw)
            raise InvalidArgumentError("Route '%s' not found in this %s object." % (target, self.__class__.__name__))
        else:
            # Build path for resource by object id
            target_id = id(target)
            if target_id in self._lookup:
                return self._lookup[target_id].path(args, kw)
            raise InvalidArgumentError("No Route found for target '%s' in this %s object." % (target, self.__class__.__name__))