code: def addinstance(self, testfile, features, classlabel="?"):
          
  
          features = self.validatefeatures(features)
  
          if self.delimiter in classlabel:
              raise ValueError("Class label contains delimiter: " + self.delimiter)
  
  
          f = io.open(testfile,'a', encoding=self.encoding)
          f.write(self.delimiter.join(features) + self.delimiter + classlabel + "\n")
          f.close()
docs: Adds an instance to a specific file. Especially suitable for generating test files