file handling reads aircraft incident data from infile and writes the data to outfile the data formats used depend on the file extensionsaix is xmlait is text (utf- encoding)aib is binaryaip is pickleand html is html (only allowed for the outfileall formats are platform-independent options- --help show this help message and exit - --force write the outfile even if it exists [defaultoff- --verbose report results [defaultoff- reader--reader=reader reader (xml)'dom'' ''etree'' ''sax''sreader (text)'manual'' ''regex'' [defaultetree for xmlmanual for text- writer--writer=writer writer (xml)'dom'' ''etree'' ''manual'' [defaultmanual- --compress compress aibaip outfile [defaultoff- --test execute doctests and exit (use with - for verbosethe options are more complex than would normally be required since an end-user will not care which reader or writer we use for any particular format in more realistic version of the program the reader and writer options would not exist and we would implement just one reader and one writer for each format similarlythe test option exists to help us test the code and would not be present in production version the program defines one custom exceptionclass incidenterror(exception)pass aircraft incidents are held as incident objects here is the class line and the initializerclass incidentdef __init__(selfreport_iddateairportaircraft_idaircraft_typepilot_percent_hours_on_typepilot_total_hoursmidairnarrative="")assert len(report_id> and len(report_id split()= "invalid report idself __report_id report_id self date date self airport airport self aircraft_id aircraft_id self aircraft_type aircraft_type self pilot_percent_hours_on_type pilot_percent_hours_on_type