def run_task(self, task):
name = task['<STR_LIT:name>']<EOL>method = task['<STR_LIT>']<EOL>url = task['<STR_LIT:url>']<EOL>headers = dict(task['<STR_LIT>'])<EOL>environ = {<EOL>'<STR_LIT>': StringIO.StringIO(base64.b64decode(task['<STR_LIT:body>'])),<EOL>'<STR_LIT>': sys.stderr,<EOL>'<STR_LIT>': method,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': url,<EOL>'<STR_LIT>': headers.get('<STR_LIT>', '<STR_LIT>'),<EOL>'<STR_LIT>': headers.get('<STR_LIT>', '<STR_LIT>'),<EOL>'<STR_LIT>': name,<EOL>'<STR_LIT>': self.queue_name,<EOL>}<EOL>match_url = url<EOL>if method == '<STR_LIT:GET>':<EOL><INDENT>environ['<STR_LIT>'], environ['<STR_LIT>'] = (<EOL>(url.split('<STR_LIT:?>', <NUM_LIT:1>) + ['<STR_LIT>'])[:<NUM_LIT:2>])<EOL>match_url = environ['<STR_LIT>']<EOL><DEDENT>logging.debug('<STR_LIT>', method, url, name)<EOL>for pattern, handler_class in pipeline.create_handlers_map():<EOL><INDENT>the_match = re.match('<STR_LIT>' % pattern, match_url)<EOL>if the_match:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.fail('<STR_LIT>' % (method, url))<EOL><DEDENT>handler = handler_class()<EOL>request = webapp.Request(environ)<EOL>response = webapp.Response()<EOL>handler.initialize(request, response)<EOL>getattr(handler, method.lower())(*the_match.groups())<EOL>
Runs the given task against the pipeline handlers.