code: def __init__(
      self,
      dataset,
      template,
      tokenizer_wrapper=None,
      tokenizer=None,
      tokenizer_wrapper_class=None,
      verbalizer=None,
      max_seq_length: Optional[str] = 512,
      batch_size: Optional[int] = 1,
      shuffle: Optional[bool] = False,
      teacher_forcing: Optional[bool] = False,
      decoder_max_length: Optional[int] = -1,
      predict_eos_token: Optional[bool] = False,
      truncate_method: Optional[str] = "tail",
      drop_last: Optional[bool] = False,
      **kwargs,
  ):
      assert hasattr(
          dataset, "__iter__"
      ), f"The dataset must have __iter__ method. dataset is {dataset}"
      assert hasattr(
          dataset, "__len__"
      ), f"The dataset must have __len__ method. dataset is {dataset}"
      self.raw_dataset = dataset
  
      self.wrapped_dataset = []
      self.tensor_dataset = []
      self.template = template
      self.verbalizer = verbalizer
      self.batch_size = batch_size
      self.shuffle = shuffle
      self.teacher_forcing = teacher_forcing
  
      if tokenizer_wrapper is None:
          if tokenizer_wrapper_class is None:
              raise RuntimeError(
                  "Either wrapped_tokenizer or tokenizer_wrapper_class should be specified."
              )
          if tokenizer is None:
              raise RuntimeError(
                  "No tokenizer specified to instantiate tokenizer_wrapper."
              )
  
          tokenizer_wrapper_init_keys = signature(
              tokenizer_wrapper_class.__init__
          ).args
          prepare_kwargs = {
              "max_seq_length": max_seq_length,
              "truncate_method": truncate_method,
              "decoder_max_length": decoder_max_length,
              "predict_eos_token": predict_eos_token,
              "tokenizer": tokenizer,
              **kwargs,
          }
  
          to_pass_kwargs = {
              key: prepare_kwargs[key]
              for key in prepare_kwargs
              if key in tokenizer_wrapper_init_keys
          }
          self.tokenizer_wrapper = tokenizer_wrapper_class(
              **to_pass_kwargs
          )
      else:
          self.tokenizer_wrapper = tokenizer_wrapper
  
      # check the satisfiability of each component
      assert hasattr(
          self.template, "wrap_one_example"
      ), "Your prompt has no function variable \
                                                           named wrap_one_example"
  
      # process
      self.wrap()
      self.tokenize()
  
      self.dataloader = create_dataloader(
          dataset_origin=self.tensor_dataset,
          batch_size=batch_size,
          batchify_fn=batchify_fn,
      )
  
file_path: OpenPrompt/tutorial/7_ernie_paddlepaddle/dataloader.py
imports: from typing import *
  from tqdm import tqdm
  from collections import defaultdict
  import warnings
  import numpy
  from paddlenlp.data import Stack, Tuple, Pad
  import paddle
  from utils import signature
  from data_utils import InputFeatures
label_desc: Use image node_id 1 to create a new ErniePromptDataLoader object  with example: obj = ErniePromptDataLoader(dataset, template, tokenizer_wrapper, tokenizer, tokenizer_wrapper_class, verbalizer, max_seq_length, batch_size, shuffle, teacher_forcing, decoder_max_length, predict_eos_token, truncate_method, drop_last)