<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def leave(self, _id):
 """ Leave a room """

        if SockJSRoomHandler._room.has_key(self._gcls() + _id):
            SockJSRoomHandler._room[self._gcls() + _id].remove(self)
            if len(SockJSRoomHandler._room[self._gcls() + _id]) == 0:
                del SockJSRoomHandler._room[self._gcls() + _id]