The specific line to which you are referring is:
utf8Stream = Utf8Reader(inStream)
During import using a UDF, Xcalar Design passes the file contents as a bytestream, a stream of data in bytes. The Utf-8Reader line, above, converts that bytestream to UTF-8. Since Python 3.6 natively accepts UTF-8 characters in strings, this conversion transforms the bytestream into string data.
Did that answer your question?