def _generate_url(self, regex, arguments):
regex_tokens = _split_regex(regex)<EOL>result = '<STR_LIT>'<EOL>for i in range(len(arguments)):<EOL><INDENT>result = result + str(regex_tokens[i]) + str(arguments[i])<EOL><DEDENT>if len(regex_tokens) > len(arguments):<EOL><INDENT>result += regex_tokens[-<NUM_LIT:1>]<EOL><DEDENT>return result<EOL>
Uses the regex (of the type defined in Django's url patterns) and the arguments to return a relative URL
For example, if the regex is '^/api/shreddr/job/(?P<id>[\d]+)$' and arguments is ['23']
then return would be '/api/shreddr/job/23'