class_docstr: Transformation abstract class.
  
  Parameters
  ----------
  p : float or None
      Probability of executing this transform
  data_indices : tuple or None
      Indices where the transforms need to be applied
class_docstr_tok: ["Transformation","abstract","class",".","Parameters","--","--","--","--","--","p",":","float","or","None","Probability","of","executing","this","transform","data_indices",":","tuple","or","None","Indices","where","the","transforms","need","to","be","applied"]
docstr: Applies transformation to a DataContainer items depending on the type.
  
  Parameters
  ----------
  data : DataContainer
      Data to be augmented
  
  Returns
  -------
  out : DataContainer
      Result
code: def apply(self, data: DataContainer):
      """
      Applies transformation to a DataContainer items depending on the type.
  
      Parameters
      ----------
      data : DataContainer
          Data to be augmented
  
      Returns
      -------
      out : DataContainer
          Result
  
      """
      result = []
      types = []
      settings = {}
      if self.data_indices is None:
          self.data_indices = tuple(range(len(data)))
      tmp_item = None
      for i, (item, t, item_settings) in enumerate(data):
          if i in self.data_indices:
              if t == "I":  # Image
                  tmp_item = self._apply_img(item, item_settings)
              elif t == "M":  # Mask
                  tmp_item = self._apply_mask(item, item_settings)
              elif t == "P":  # Points
                  tmp_item = self._apply_pts(item, item_settings)
              elif t == "L":  # Labels
                  tmp_item = self._apply_labels(item, item_settings)
          else:
              if t == "I" or t == "M":
                  tmp_item = item.copy()
              elif t == "L":
                  tmp_item = copy.copy(item)
              elif t == "P":
                  tmp_item = copy.copy(item)
  
          types.append(t)
          result.append(tmp_item)
          settings[i] = item_settings
  
      return DataContainer(data=tuple(result), fmt="".join(types))
  
imports: import copy
  import random
  from abc import ABCMeta, abstractmethod
  import cv2
  import numpy
  from solt.utils import Serializable
  from solt.constants import ALLOWED_INTERPOLATIONS, ALLOWED_PADDINGS
  from ._data import DataContainer, Keypoints
  from solt.utils import img_shape_checker, validate_parameter
label_desc: Use image node_id 5 for calling the BaseTransform obj's underlying member method code with example usage: obj.apply(data) and returns: DataContainer