def METHOD_NAME(
    self, preferred_aircraft: str, task: FlightType, control_point: ControlPoint
) -> Optional[SquadronDef]:
    # Attempt to find a squadron with the name in the request.
    squadron_def = self.find_squadron_by_name(
        preferred_aircraft, task, control_point
    )
    if squadron_def is not None:
        return squadron_def
    # If the name didn't match a squadron available to this coalition, try to find
    # an aircraft with the matching name that meets the requirements.
    try:
        aircraft = AircraftType.named(preferred_aircraft)
    except KeyError:
        logging.warning(
            "%s is neither a compatible squadron or a known aircraft type, "
            "ignoring",
            preferred_aircraft,
        )
        return None
    if aircraft not in self.coalition.faction.aircrafts:
        return None
    lo = self.coalition.faction.liveries_overrides
    squadron_def = self.find_squadron_for_airframe(aircraft, task, control_point)
    if squadron_def is not None and lo.get(aircraft) is None:
        return squadron_def
    # No premade squadron available for this aircraft that meets the requirements,
    # so generate one if possible.
    return self.air_wing.squadron_def_generator.generate_for_aircraft(aircraft)