code: def read_file(self, infile):
          
          try:
              encoding = self._encoding if self._encoding else None
              mode = 'r' if self._encoding else 'rU'
              with codecs.open(infile.name, mode, encoding=encoding) as f:
                  lines = f.readlines()
          except AttributeError:
              lines = infile.readlines()
          lines = [line.strip() for line in lines]
          return lines
docs: Given an input file read its contents, strip whitespace from the
           beginning and end of each line and return a list of the preprocessed
           lines read.
  
          :param infile: file that contains the data to be read
          :return: list of the read lines with stripped whitespace