class_docstr: An abstract class for a dataset.
class_docstr_tok: ["An","abstract","class","for","a","dataset","."]
docstr: Return the data AFTER preprocessing if preprocessing is not None.
docstr_tok: ["Return","the","data","AFTER","preprocessing","if","preprocessing","is","not","None","."]
code: def load_or_generate_data(self, force_generate=False, save=True):
      """
      Return the data AFTER preprocessing if preprocessing is not None.
      """
      files_exist = (
          os.path.isfile(self.out_dir + self.name + "X_train.npy")
          and os.path.isfile(self.out_dir + self.name + "Y_train.npy")
          and os.path.isfile(self.out_dir + self.name + "X_test.npy")
      )
  
      if (force_generate) or (not files_exist):
          (
              self.X_train,
              self.Y_train,
              self.X_test,
              self.Y_test,
          ) = self._generate_data()
          self._save_data(
              self.X_train, self.Y_train, self.X_test, self.Y_test, save
          )
      else:
          (
              self.X_train,
              self.Y_train,
              self.X_test,
              self.Y_test,
          ) = self._load_data()
  
      if self.preprocess == "standardise":
          return self._standardise(
              self.X_train, self.Y_train, self.X_test, self.Y_test
          )
      else:
          return [self.X_train, self.Y_train, self.X_test, self.Y_test]
  
imports: import numpy
  import os.path
label_desc: Use image node_id 5 for calling the Dataset obj's underlying member method code with example usage: obj.load_or_generate_data(force_generate, save) and returns: self, list