class_docstr: Any iterable of (label, text_input) pairs qualifies as a ``Dataset``.
class_docstr_tok: ["Any","iterable","of","(","label",",","text_input",")","pairs","qualifies","as","a","``","Dataset","``","."]
docstr: Load single data sample and append to dataset.
  
  :param dict|sample data_sample:
  :param int sample_id: useful to identify sample, default -1
  :return: True / False indicate whether append action successful.
docstr_tok: ["Load","single","data","sample","and","append","to","dataset",".",":","param","dict|sample","data_sample",":",":","param","int","sample_id",":","useful","to","identify","sample",",","default","-1",":","return",":","True","\/","False","indicate","whether","append","action","successful","."]
code: def append(self, data_sample, sample_id=-1):
      r"""
      Load single data sample and append to dataset.
  
      :param dict|sample data_sample:
      :param int sample_id: useful to identify sample, default -1
      :return: True / False indicate whether append action successful.
  
      """
      load_success = False
      # default Sample input with sample_id
      if isinstance(data_sample, Sample) or isinstance(
          data_sample, CnSample
      ):
          # different type would raise error
          if self.task.lower() not in data_sample.__repr__().lower():
              logger.error(
                  "Input data sample type {0} is not compatible with task {1}".format(
                      data_sample.__repr__(), self.task
                  )
              )
          else:
              try:
                  # invalid data sample will filed in dump step
                  data_sample.dump()
                  self.dataset.append(data_sample)
                  load_success = True
              except ValueError as e:
                  logger.error(str(e))
                  logger.error(
                      "Invalid data sample {0} cuz its failed dump.".format(
                          data_sample
                      )
                  )
      elif isinstance(data_sample, dict):
          try:
              self.dataset.append(
                  sample_map[self.task](
                      data_sample, sample_id=sample_id
                  )
              )
              load_success = True
          except (ValueError, AssertionError) as e:
              logger.error(str(e))
              logger.error(
                  "Data input {0} load failed, skip this sample".format(
                      data_sample, self.task
                  )
              )
      else:
          logger.error(
              "Not support append {0} type data to dataset, "
              "check the input ".format(type(data_sample))
          )
  
      return load_success
  
imports: from tqdm import tqdm
  from ...common.utils import logger
  from ..component.sample import Sample, CnSample
  from ...common.utils.load import task_class_load
  from ...common.settings import SAMPLE_PATH, NLP_TASK_MAP
  from ...common.utils.file_io import read_csv, read_json, save_csv, save_json
label_desc: Use image node_id 14 for calling the Dataset obj's underlying member method code with example usage: obj.append(data_sample, sample_id) and returns: load_success