def get_requests(self, params={}):
if "<STR_LIT:status>" in params:<EOL><INDENT>params['<STR_LIT:status>'] = '<STR_LIT:U+002C>'.join(map(str, params['<STR_LIT:status>']))<EOL><DEDENT>requests = []<EOL>users = {}<EOL>messages = {}<EOL>params['<STR_LIT>'] = <NUM_LIT:0><EOL>while True:<EOL><INDENT>param_list = [(k, params[k]) for k in sorted(params)]<EOL>url = "<STR_LIT>" % urlencode(param_list)<EOL>data = self._get_resource(url)<EOL>for entry in data["<STR_LIT>"]:<EOL><INDENT>user = Users.user_from_json(entry)<EOL>users[user.user_id] = user<EOL><DEDENT>for entry in data["<STR_LIT>"]:<EOL><INDENT>request = self.request_from_json(entry)<EOL>requests.append(request)<EOL><DEDENT>for entry in data["<STR_LIT>"]:<EOL><INDENT>message = Messages.message_from_json(entry)<EOL>if message.request_id not in messages:<EOL><INDENT>messages[message.request_id] = []<EOL><DEDENT>messages[message.request_id].append(message)<EOL><DEDENT>if not data['<STR_LIT>']:<EOL><INDENT>break<EOL><DEDENT>params['<STR_LIT>'] += <NUM_LIT:1><EOL><DEDENT>for request in requests:<EOL><INDENT>request.user = users.get(request.user_id, None)<EOL>request.messages = messages.get(request.request_id, [])<EOL><DEDENT>return requests<EOL>
List requests

http://dev.wheniwork.com/#listing-requests