def build(self, _name, *anons, **query):
builder = self.builder.get(_name)<EOL>if not builder: raise RouteBuildError("<STR_LIT>", _name)<EOL>try:<EOL><INDENT>for i, value in enumerate(anons): query['<STR_LIT>'%i] = value<EOL>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 as e:<EOL><INDENT>raise RouteBuildError('<STR_LIT>' % e.args[<NUM_LIT:0>])<EOL><DEDENT>
Build an URL by filling the wildcards in a rule.