01234567890123456789012345678901234567890123456789012345678901234567890123456789
26662667266826692670267126722673267426752676267726782679268026812682268326842685 268626872688 268926902691269226932694269526962697269826992700270127022703270427052706270727082709 | <----SKIPPED LINES----> which we are attempting to generate an insight. percent_size_difference: the minimum size (i.e.: length) difference for the insight to warrant including the size details. Returns: Printable string message; if no message or insights to generate, then an empty string. """ message = '' this_flight = flights[-1] this_flight_number = DisplayFlightNumber(this_flight) last_seen = [ f for f in flights[:-1] if DisplayFlightNumber(f) == this_flight_number] # Last time this same flight flew a materially different type of aircraft if last_seen and 'flight_number' in this_flight: last_flight = last_seen[-1] last_aircraft = last_flight.get('aircraft_type_friendly') last_aircraft_length = AIRCRAFT_LENGTH.get(last_aircraft.upper(), 0) this_aircraft = this_flight.get('aircraft_type_friendly') this_aircraft_length = AIRCRAFT_LENGTH.get(this_aircraft.upper(), 0) this_likely_commercial_flight = ( this_flight.get('origin_iata') and this_flight.get('destination_iata')) if (this_likely_commercial_flight and this_aircraft and not this_aircraft_length): Log('%s used in a flight with defined origin & destination but yet is ' 'missing length details' % this_aircraft, file=LOGFILE) WriteFile(NEW_AIRCRAFT_FILE, this_aircraft, append=True) likely_same_commercial_flight = ( last_flight.get('origin_iata') == this_flight.get('origin_iata') and last_flight.get( 'destination_iata') == this_flight.get('destination_iata') and last_flight.get( 'airline_call_sign') == this_flight.get('airline_call_sign')) this_aircraft_bigger = False last_aircraft_bigger = False if (likely_same_commercial_flight and this_aircraft_length > last_aircraft_length * ( <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713 | <----SKIPPED LINES----> which we are attempting to generate an insight. percent_size_difference: the minimum size (i.e.: length) difference for the insight to warrant including the size details. Returns: Printable string message; if no message or insights to generate, then an empty string. """ message = '' this_flight = flights[-1] this_flight_number = DisplayFlightNumber(this_flight) last_seen = [ f for f in flights[:-1] if DisplayFlightNumber(f) == this_flight_number] # Last time this same flight flew a materially different type of aircraft if last_seen and 'flight_number' in this_flight: last_flight = last_seen[-1] last_aircraft = last_flight.get('aircraft_type_friendly') last_aircraft_length = 0 if last_aircraft: last_aircraft_length = AIRCRAFT_LENGTH.get(last_aircraft.upper(), 0) this_aircraft = this_flight.get('aircraft_type_friendly') this_aircraft_length = 0 if this_aircraft: this_aircraft_length = AIRCRAFT_LENGTH.get(this_aircraft.upper(), 0) this_likely_commercial_flight = ( this_flight.get('origin_iata') and this_flight.get('destination_iata')) if (this_likely_commercial_flight and this_aircraft and not this_aircraft_length): Log('%s used in a flight with defined origin & destination but yet is ' 'missing length details' % this_aircraft, file=LOGFILE) WriteFile(NEW_AIRCRAFT_FILE, this_aircraft, append=True) likely_same_commercial_flight = ( last_flight.get('origin_iata') == this_flight.get('origin_iata') and last_flight.get( 'destination_iata') == this_flight.get('destination_iata') and last_flight.get( 'airline_call_sign') == this_flight.get('airline_call_sign')) this_aircraft_bigger = False last_aircraft_bigger = False if (likely_same_commercial_flight and this_aircraft_length > last_aircraft_length * ( <----SKIPPED LINES----> |