human
Complete this python program:
def _map_redirects(mapper):
assistant
#Here is the Python program you requested.

    """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.
    """
    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