def getDevicesById(self): 
rows = self.camera_collection.get()<EOL>devices_by_id = {}<EOL>for row in rows:<EOL><INDENT>classname=row.pop("<STR_LIT>")<EOL>if (classname == "<STR_LIT>"):<EOL><INDENT>device = DataModel.RTSPCameraDevice(**row)<EOL><DEDENT>elif (classname == "<STR_LIT>"):<EOL><INDENT>device = DataModel.USBCameraDevice(**row)<EOL><DEDENT>else:<EOL><INDENT>device = None<EOL><DEDENT>if (device):<EOL><INDENT>devices_by_id[device._id] = device<EOL><DEDENT><DEDENT>return devices_by_id<EOL>
rows = self.camera_collection.get(query)
devices_by_id = {}
for row in rows:
    row.pop("classname")
    device = DataModel.RTSPCameraDevice(**row)
    devices_by_id[device._id] = device
return devices_by_id