code: def append_extra_datapoint(to_data, from_data, index) -> DatasetLike:
      """Appends an extra datapoint to the data object ``to_data``.
      This datapoint is taken from the data object ``from_data`` at the corresponding index.
      One place this could be useful is ensuring no missing classes after train/validation split.
      """
      if not (type(from_data) is type(to_data)):
          raise ValueError(
              "Cannot append datapoint from different type of data object."
          )
  
      if isinstance(to_data, np.ndarray):
          return np.vstack([to_data, from_data[index]])
      elif isinstance(from_data, (pd.DataFrame, pd.Series)):
          X_extra = from_data.iloc[[index]]  # type: ignore
          to_data = pd.concat([to_data, X_extra])
          return to_data.reset_index(drop=True)
      else:
          try:
              X_extra = from_data[index]
              try:
                  return to_data.append(X_extra)
              except Exception:  # special append for sparse matrix
                  return csr_vstack(to_data, X_extra)
          except Exception:
              raise TypeError(
                  "Data features X must support: X.append(X[i])"
              )
  
imports: import warnings
  import numpy
  import pandas
  from typing import Union, Tuple
  from cleanlab.typing import DatasetLike, LabelLike
  from cleanlab.internal.validation import labels_to_array
  from cleanlab.internal.constants import FLOATING_POINT_COMPARISON, TINY_VALUE
label_desc: Use image node_id 25 for calling a global function with example usage: append_extra_datapoint(to_data, from_data, index) and returns: np, to_data, to_data, csr_vstack