<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def public_broadcaster():
 """ Thread which runs in parallel and constantly checks for new messages in the public pipe and broadcasts them publicly to all connected clients. """

    while __websocket_server_running__:
        pipein = open(PUBLIC_PIPE, 'r')
        line = pipein.readline().replace('\n', '').replace('\r', '')
        if line != '':
            WebSocketHandler.broadcast(line)
            print line
            
            remaining_lines = pipein.read()
            pipein.close()
            pipeout = open(PUBLIC_PIPE, 'w')
            pipeout.write(remaining_lines)
            pipeout.close()
        else:
            pipein.close()
        
        time.sleep(0.05)