python question on classification and filtering

Hello, I am trying to get those python functions to work. There are few bugs I encountered. Primarily in the get-fh function and classification function (get_header_and_sequence_lists). I attached my functions in the python file, input file, and requirement below.