code: def build_detection_dataset(folder, dataset_filename,
                              sender_known=True):
      
      if os.path.exists(dataset_filename):
          os.remove(dataset_filename)
      build_detection_class(os.path.join(folder, u'P'),
                            dataset_filename, 1)
      build_detection_class(os.path.join(folder, u'N'),
                            dataset_filename, -1)
docs: Builds signature detection dataset using emails from folder.
  
      folder should have the following structure:
      x-- folder
      |    x-- P
      |    |    | -- positive sample email 1
      |    |    | -- positive sample email 2
      |    |    | -- ...
      |    x-- N
      |    |    | -- negative sample email 1
      |    |    | -- negative sample email 2
      |    |    | -- ...
  
      If the dataset file already exist it is rewritten.