<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fill_fw_dict_from_db(self, fw_data):
 """ This routine is called to create a local fw_dict with data from DB. """

        rule_dict = fw_data.get('rules').get('rules')
        fw_dict = {'fw_id': fw_data.get('fw_id'),
                   'fw_name': fw_data.get('name'),
                   'firewall_policy_id': fw_data.get('firewall_policy_id'),
                   'fw_type': fw_data.get('fw_type'),
                   'router_id': fw_data.get('router_id'), 'rules': {}}
        for rule in rule_dict:
            fw_dict['rules'][rule] = rule_dict.get(rule)
        return fw_dict