Fetches the ids of the rooms with the given names

def fetch_room_ids(self, names):
        """ Fetches the ids of the rooms with the given names """
        ret = dict()
        names_set = frozenset(names)
        for d in json.loads(self.open_url(
                            'timetables?type=location'))['timetable']:
            name = d['hostKey']
            if name in names_set:
                ret[name] = d['value'].encode('utf-8')
        return ret