Check a given user is in given room
345221
def isInRoom(self, _id):
        
        if SockJSRoomHandler._room.has_key(self._gcls() + _id):
            if self in SockJSRoomHandler._room[self._gcls() + _id]:
                return True
        return False
575434
synchronized private MeetmeRoom findMeetmeRoom(final String roomNumber)
    {
        MeetmeRoom foundRoom = null;
        for (final MeetmeRoom room : this.rooms)
        {
            if (room.getRoomNumber().compareToIgnoreCase(roomNumber) == 0)
            {
                foundRoom = room;
                break;
            }
        }
        return foundRoom;
    }
988457
def typing(self, room: Room, timeout: int = 5000):
        
        path = f'/rooms/{quote(room.room_id)}/typing/{quote(self.user_id)}'
        return self.api._send('PUT', path, {'typing': True, 'timeout': timeout})
967808
def check_user_by_name(user_name, u_pass):
        '''
        
        '''
        the_query = TabMember.select().where(TabMember.user_name == user_name)
        if the_query.count() == 0:
            return -1

        the_user = the_query.get()
        if the_user.user_pass == tools.md5(u_pass):
            return 1
        return 0
32019
def login_transplant(self, other):
        """"""

        if not other.logged_in:
            raise ValueError("Other room is not logged in")
        cookie = other.session
        if not cookie:
            raise ValueError("Other room has no cookie")
        self.conn.cookies.update({"session": cookie})
        self.session = cookie
        self.logged_in = True
        return True
118269
function( userId ) {
		return this.memory.getPublicRoom()
		.then(function( roomId ) {
			if ( roomId ) {
				return this.enter( userId, roomId);
			} else {
				return promise.reject( 'Could not find a public room' );
			}
		}.bind(this));
	}
1260003
def close_room(self, room, namespace):
        """"""
        try:
            for sid in self.get_participants(namespace, room):
                self.leave_room(sid, namespace, room)
        except KeyError:
            pass
1099948
def im_open(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('im.open', roomId=room_id, kwargs=kwargs)
1084658
def update_room_from_obj(settings, vc_room, room_obj):
    """"""
    vc_room.name = room_obj.name
    if room_obj.ownerName != vc_room.data['owner_identity']:
        owner = get_user_from_identifier(settings, room_obj.ownerName) or User.get_system_user()
        vc_room.vidyo_extension.owned_by_user = owner

    vc_room.data.update({
        'description': room_obj.description,
        'vidyo_id': unicode(room_obj.roomID),
        'url': room_obj.RoomMode.roomURL,
        'owner_identity': room_obj.ownerName,
        'room_pin': room_obj.RoomMode.roomPIN if room_obj.RoomMode.hasPIN else "",
        'moderation_pin': room_obj.RoomMode.moderatorPIN if room_obj.RoomMode.hasModeratorPIN else "",
    })
    vc_room.vidyo_extension.extension = int(room_obj.extension)
833738
function( userID, roomID ) {

		var userCount;

		if( roomUsers[ roomID ] === undefined ) {

			return promise.reject( 'No room with the id: ' + roomID );
		} else {

			var userIDX = roomUsers[ roomID ].indexOf( userID );

			if( userIDX != -1 ) {

				roomUsers[ roomID ].splice( userIDX, 1 );

				userCount = roomUsers[ roomID ].length;

				if( userCount == 0 ) {

					delete roomUsers[ roomID ];
				}

				return promise.resolve( userCount );
			} else {

				return promise.reject( 'User ' + userID + ' is not in the room: ' + roomID );
			}
		}
	}
855087
def current_tenant=(val)
      key = :"roomer_current_tenant"
      unless  Thread.current[key].try(:url_identifier) == val.try(:url_identifier)
        Thread.current[key] = val
        ensure_tenant_model_reset
      end
      Thread.current[key]
    end
1272018
def room(self, name, participantIdentity=None, **kwargs):
        
        return self.nest(Room(name, participantIdentity=participantIdentity, **kwargs))
204616
def rooms_favorite(self, room_id=None, room_name=None, favorite=True):
        """"""
        if room_id is not None:
            return self.__call_api_post('rooms.favorite', roomId=room_id, favorite=favorite)
        elif room_name is not None:
            return self.__call_api_post('rooms.favorite', roomName=room_name, favorite=favorite)
        else:
            raise RocketMissingParamException('roomId or roomName required')
610335
def _mkroom(self, room_id: str) -> Room:
        
        if room_id not in self.rooms:
            self.rooms[room_id] = Room(self, room_id)
        room = self.rooms[room_id]
        if not room.canonical_alias:
            room.update_aliases()
        return room
1297497
function( userId, id ) {

		return this.memory.leaveRoom( userId, id )
		.then( function( numUsers ) {

			if( numUsers == 0 ) {

				// remove all listeners from room since there should be one
				rooms[ id ].removeAllListeners();
				rooms[ id ].setPrivate();
				delete rooms[ id ];
				
				return promise.resolve( null );
			} else {

				return promise.resolve( rooms[ id ] );
			}
		});
	}
657667
public synchronized MeetmeRoom findAvailableRoom(RoomOwner newOwner)
    {
        int count = 0;
        for (final MeetmeRoom room : this.rooms)
        {
            if (MeetmeRoomControl.logger.isDebugEnabled())
            {
                MeetmeRoomControl.logger.debug("room " + room.getRoomNumber() + " count " + count);
            }
            if (room.getOwner() == null || !room.getOwner().isRoomStillRequired())
            {
                /*
                 * new code to attempt to recover uncleared meetme rooms safely
                 */
                try
                {
                    final Date lastUpdated = room.getLastUpdated();
                    final long now = new Date().getTime();
                    if (lastUpdated != null)
                    {
                        final long elapsedTime = now - lastUpdated.getTime();
                        MeetmeRoomControl.logger
                                .debug("room: " + room.getRoomNumber() + " count: " + count + " elapsed: " + elapsedTime);
                        if ((elapsedTime > 7200000) && (room.getChannelCount() == 1))
                        {
                            MeetmeRoomControl.logger.debug("clearing room"); //$NON-NLS-1$
                            room.setInactive();
                        }
                    }
                }
                catch (final Exception e)
                {
                    /*
                     * attempt to make this new change safe
                     */
                    MeetmeRoomControl.logger.error(e, e);
                }

                if (room.getChannelCount() == 0)
                {
                    room.setInactive();
                    room.setOwner(newOwner);
                    MeetmeRoomControl.logger.warn("Returning available room " + room.getRoomNumber());
                    return room;
                }

            }
            else
            {
                logger.warn("Meetme " + room.getRoomNumber() + " is still in use by " + room.getOwner());
            }
            count++;
        }
        MeetmeRoomControl.logger.error("no more available rooms");
        return null;

    }
449561
def isroom_change(self):
        '''
        
        '''
        if self.isroom is False:
            self.status = 'occupied'
        if self.isroom is True:
            self.status = 'available'