code: def read(self, given_file):
          if self.unique is not False and self.unique is not True:
              raise AttributeError("Attribute 'unique' is not True or False.")
          self.filename = str.strip(given_file)
          self.log('Read-only opening {0}'.format(self.filename))
          with open(self.filename, 'r') as handle:
              for line in handle:
                  line = line.rstrip('\r\n')
                  if line is None:
                      line = ''
                  if self.unique is False or line not in self.contents:
                      self.contents.append(line)
          if self.sorted:
              self.sort()
          self.log('Read {0} lines.'.format(len(self.contents)))
          return True