human
Complete the below
def _map_redirects(mapper):

    ''''Add redirect to the Routes mapper and forward the received query string.
    Subsequently when the redirect is triggered in Routes middleware the request
    will not even reach the webapp.'
    '''
 ... Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.
    def forward_qs(environ, result):
        qs_dict = parse_qs(environ['QUERY_STRING'])
        for qs in qs_dict:
            result[qs] = qs_dict[qs]
        return True
    mapper.redirect('/repository/status_for_installed_repository', '/api/repositories/updates/', _redirect_code='301    Moved    Permanently', conditions=dict(function=forward_qs))
    return mapper