<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _unregister_socket(s):
        '''
        Internal method used to remove the socket from AppLayer registry.
        Warns if the "upward" socket queue has any left-over data.  
        '''
        with _lock:
            sock_queue = ApplicationLayer._to_app.pop(s._sockid())
        if not sock_queue.empty():
            log_warn("Socket being destroyed still has data enqueued for application layer.")