<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def allocate_fw_dev(self, fw_id):
 """Allocate firewall device. Allocate the first Firewall device which has resources available. """

        for cnt in self.res:
            used = self.res.get(cnt).get('used')
            if used < self.res.get(cnt).get('quota'):
                self.res[cnt]['used'] = used + 1
                self.res[cnt]['fw_id_lst'].append(fw_id)
                return self.res[cnt].get('obj_dict'), (
                    self.res[cnt].get('mgmt_ip'))
        return None, None