code: def load_data(dataset_path: str, max_length: int = 0):
      """Load dataset from split (train, valid, test).
      This is designed for single sentence format.
  
      Args:
          dataset_path (str): path of dataset dir.
          max_length: (default = 0) The amount of line about to load. If 0, quick_test will be disabled.
  
      Returns:
          List[List[str]]: the text list loaded from dataset path.
      """
      if not os.path.isfile(dataset_path):
          raise ValueError(
              "File {} not exist".format(os.path.abspath(dataset_path))
          )
  
      text = []
      with open(dataset_path, "r") as fin:
          if max_length:
              fin = itertools.islice(fin, max_length)
          for line in fin:
              l = line.strip()
              if len(l) >= 2 and (
                  (l[0] == '"' and l[-1] == '"')
                  or (l[0] == "'" and l[-1] == "'")
                  or (l[0] == "[" and l[-1] == "]")
              ):
                  try:
                      l = eval(l)
                      if not isinstance(l, list):
                          l = str(l)
                  except:
                      pass
              text.append(l)
      return text
  
imports: from typing import List, Optional
  import itertools, os
  import torch
  from torch.nn.utils.rnn import pad_sequence
label_desc: Use image node_id 1 for calling a global function with example usage: load_data(dataset_path, max_length) and returns: text