<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def frame_from_firmware(self, firmware):
        '''extract information from firmware, return pretty string to user'''
        # see Tools/scripts/generate-manifest for this map:
        frame_to_mavlink_dict = {
            "quad": "QUADROTOR",
            "hexa": "HEXAROTOR",
            "y6": "ARDUPILOT_Y6",
            "tri": "TRICOPTER",
            "octa": "OCTOROTOR",
            "octa-quad": "ARDUPILOT_OCTAQUAD",
            "heli": "HELICOPTER",
            "Plane": "FIXED_WING",
            "Tracker": "ANTENNA_TRACKER",
            "Rover": "GROUND_ROVER",
            "PX4IO": "ARDUPILOT_PX4IO",
        }
        mavlink_to_frame_dict = { v : k  for k,v in frame_to_mavlink_dict.items() }
        x = firmware["mav-type"]
        if firmware["mav-autopilot"] != "ARDUPILOTMEGA":
            return x
        if x in mavlink_to_frame_dict:
            return mavlink_to_frame_dict[x]

        return x