code: def create_line_generator(self):
          
  
          if self.file_name.endswith(".gz"):
              if sys.version_info.major == 3:
                  gz = gzip.open(self.file_name, mode='rt', encoding=self.encoding)
              else:
                  gz = gzip.open(self.file_name, mode='rt')
  
              for line in gz.readlines():
                  yield line
  
              gz.close()
          else:
              if sys.version_info.major == 3:
                  # Python 3 native `open` is much faster
                  file = open(self.file_name, mode='r', encoding=self.encoding)
              else:
                  # Python 2 needs the codecs package to deal with encoding
                  file = codecs.open(self.file_name, mode='r', encoding=self.encoding)
  
              for line in file:
                  yield line
  
              file.close()
docs: Creates a generator function yielding lines in the file
          Should only yield non-empty lines