code: def make_room_dict(rir_list):
      """This function converts a list of RIRs into a dictionary of RIRs indexed by the room-id.
      Its values are objects with two attributes: a local RIR list
      and the probability of the corresponding room
      Please look at the comments at parse_rir_list() for the attributes that a RIR object contains
      """
      room_dict = {}
      for rir in rir_list:
          if rir.room_id not in room_dict:
              # add new room
              room_dict[rir.room_id] = lambda: None
              setattr(room_dict[rir.room_id], "rir_list", [])
              setattr(room_dict[rir.room_id], "probability", 0)
          room_dict[rir.room_id].rir_list.append(rir)
  
      # the probability of the room is the sum of probabilities of its RIR
      for key in room_dict.keys():
          room_dict[key].probability = sum(
              rir.probability for rir in room_dict[key].rir_list
          )
  
      assert almost_equal(
          sum(room_dict[key].probability for key in room_dict.keys()),
          1.0,
      )
  
      return room_dict
  
imports: import argparse, shlex, glob, math, os, random, sys, warnings, copy, imp, ast
label_desc: Use image node_id 17 for calling a global function with example usage: make_room_dict(rir_list) and returns: room_dict