code: def mode_mapping_bynumber(mav_type):
      '''return dictionary mapping mode numbers to name, or None if unknown'''
      map = None
      if mav_type in [mavlink.MAV_TYPE_QUADROTOR,
                      mavlink.MAV_TYPE_HELICOPTER,
                      mavlink.MAV_TYPE_HEXAROTOR,
                      mavlink.MAV_TYPE_OCTOROTOR,
                      mavlink.MAV_TYPE_COAXIAL,
                      mavlink.MAV_TYPE_TRICOPTER]:
          map = mode_mapping_acm
      if mav_type == mavlink.MAV_TYPE_FIXED_WING:
          map = mode_mapping_apm
      if mav_type == mavlink.MAV_TYPE_GROUND_ROVER:
          map = mode_mapping_rover
      if mav_type == mavlink.MAV_TYPE_ANTENNA_TRACKER:
          map = mode_mapping_tracker
      if map is None:
          return None
      return maf mode_mapping_bynumber(mav_type):
      '''return dictionary mapping mode numbers to name, or None if unknown'''
      map = None
      if mav_type in [mavlink.MAV_TYPE_QUADROTOR,
                      mavlink.MAV_TYPE_HELICOPTER,
                      mavlink.MAV_TYPE_HEXAROTOR,
                      mavlink.MAV_TYPE_OCTOROTOR,
                      mavlink.MAV_TYPE_COAXIAL,
                      mavlink.MAV_TYPE_TRICOPTER]:
          map = mode_mapping_acm
      if mav_type == mavlink.MAV_TYPE_FIXED_WING:
          map = mode_mapping_apm
      if mav_type == mavlink.MAV_TYPE_GROUND_ROVER:
          map = mode_mapping_rover
      if mav_type == mavlink.MAV_TYPE_ANTENNA_TRACKER:
          map = mode_mapping_tracker
      if map is None:
          return None
      return map
docs: return dictionary mapping mode numbers to name, or None if unknown