class_docstr: generate RE sample
docstr: Returns a list of all possible transformed samples for "dataset".
  
  :param ~TextRobustness.dataset.Dataset dataset: the original dataset
      ready for transformation or subpopulation
  :return: yield transformed samples + transformation name string.
code: def generate_by_transformations(self, dataset, **kwargs):
      r"""
      Returns a list of all possible transformed samples for "dataset".
  
      :param ~TextRobustness.dataset.Dataset dataset: the original dataset
          ready for transformation or subpopulation
      :return: yield transformed samples + transformation name string.
      """
      self.prepare(dataset)
      dataset.init_iter()
      transform_objs = self._get_flint_objs(
          self.transform_methods,
          TASK_TRANSFORMATION_PATH,
          ALLOWED_TRANSFORMATIONS,
      )
  
      for obj_id, trans_obj in enumerate(transform_objs):
          logger.info("******Start {0}!******".format(trans_obj))
          generated_samples = dataset.new_dataset()
          original_samples = dataset.new_dataset()
          # initialize current index of dataset
          dataset.init_iter()
  
          for index in tqdm(range(len(dataset))):
              concat_samples = dataset[index + 1 : index + 3]
              sample = dataset[index]
              # default return list of samples
              trans_rst = trans_obj.transform(
                  sample,
                  n=self.max_trans,
                  field=self.fields,
                  concat_samples=concat_samples,
              )
              # default return list of samples
              if trans_rst:
                  generated_samples.extend(trans_rst)
                  original_samples.append(sample)
  
          yield original_samples, generated_samples, trans_obj.__repr__()
          logger.info("******Finish {0}!******".format(trans_obj))
  
file_path: textflint/textflint/generation/generator/re_generator.py
imports: from .generator import Generator
  from tqdm import tqdm
  from ...common import logger
  from ...input.dataset import Dataset
  from ...common.settings import TASK_TRANSFORMATION_PATH, ALLOWED_TRANSFORMATIONS, TASK_SUBPOPULATION_PATH, ALLOWED_SUBPOPULATIONS
label_desc: Use image node_id 2 for calling the REGenerator obj's underlying member method code with example usage: obj.generate_by_transformations(dataset) without return types