def build(self, _name, *anons, **query):
builder = self.builder.get(_name)<EOL>if not builder:<EOL><INDENT>raise RouteBuildError("<STR_LIT>", _name)<EOL><DEDENT>try:<EOL><INDENT>for i, value in enumerate(anons):<EOL><INDENT>query['<STR_LIT>' % i] = value<EOL><DEDENT>url = '<STR_LIT>'.join([f(query.pop(n)) if n else f for (n, f) in builder])<EOL>return url if not query else url + '<STR_LIT:?>' + urlencode(query)<EOL><DEDENT>except KeyError:<EOL><INDENT>raise RouteBuildError('<STR_LIT>' % _e().args[<NUM_LIT:0>])<EOL><DEDENT>
Build an URL by filling the wildcards in a rule.