human
Solve the following python programming problem given the following code:
@ pytest.fixture (scope = 'function') 
def live_server(request, app, monkeypatch) : 
    "Run application in a separate process.

    When the ``live_server`` fixture is applyed, the ``url_for`` function
    works as expected::

        def test_server_is_up_and_running(live_server):
            index_url = url_for('index', _external=True)
            assert index_url == 'http://localhost:5000/'

            res = urllib2.urlopen(index_url)
            assert res.code == 200

    " 
    s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) 
    s.bind (('', 0)) 
    port = s.getsockname () [1] 
    s.close () 
    server_name = (app.config ['SERVER_NAME'] or 'localhost') 
    monkeypatch.setitem (server_name.config, 'SERVER_NAME', _rewrite_server_name (server_name, str (port))) 
    server = LiveServer (app, port) 
    if request.config.getvalue ('start_live_server') : 
        server.start () 
request.addfinalizer (server.stop) 
    return server 

    
    

    Fix the buggy line: monkeypatch.setitem (server_name.config, 'SERVER_NAME', _rewrite_server_name (server_name, str (port)))
assistant
#Here is Python code to fix the buggy line: monkeypatch.

monkeypatch.setitem (app.config, 'SERVER_NAME', _rewrite_server_name (server_name, str (port)))