class_docstr: Data container to encapsulate different types of data, such as images, bounding boxes, etc.
  
  The container itself is iterable according to the format.
  Data container assumes the same coordinate system for all the items it is storing.
  For instance, the behavior shown below is not supported:
  
  .. highlight:: python
  .. code-block:: python
  
      from solt.core import DataContainer
      import numpy as np
  
      img1 = np.ones((100, 100, 3), dtype=np.int32)
      img2 = np.ones((110, 110, 3), dtype=np.int32)
      trf_img = DataContainer.from_dict({'images': (img1, img2)})
  
  Parameters
  ----------
  data : tuple
      Data items stored in a tuple
  fmt : str
      Data format. Example: 'IMMM' - image and three masks.
  transform_settings : dict or None
      Settings for each data item. At this stage, the settings include only padding and interpolation.
      The key in this dict corresponds to the index of the element in the given data tuple.
      The value is another dict, which has all the settings. Segmentation masks have nearest neighbor interpolation
      by default, this can be changed manually if needed.
      Example: ``transform_settings={0:{'interpolation':'bilinear'}, 1: {'interpolation':'bicubic'}}``
docstr: Creates a data container from a dictionary.
  
  If data is a dict, then the ``solt.data.DataContainer`` will be created so that the
  ``image`` data will be stored first. Subsequently, multiple images under the key ``images``
  will be stored. The same applies to masks (first ``mask`` and then ``masks``),
  labels (``label`` and ``labels``), and the keypoints (``keypoints`` and ``keypoints_array``).
  You must use ``solt.data.KeyPoints`` object here. Labels will always be stored last.
  
  For example, if the input ``dict`` looks like this: ``d = {'label': l1, 'image': i1, 'mask': m1}`` or
  ``d = {'mask': m1, 'image': i1, 'label': l1}``, the ``DataContainer`` will convert this
  into ``sld.DataContainer((i1, m1, l1), 'IML')``.
  
  More complex case:
  
  .. highlight:: python
  .. code-block:: python
  
      d = {'image': i1, masks: (m1, m2, m3, m4), 'labels': (l1, l2, l3, l4, l5),
      'keypoints': solt.core.KeyPoints(k, h, w)
      dc_from_dict = solt.core.DataContainer.from_dict(d)
  
  will be equivalent to
  
  .. highlight:: python
  .. code-block:: python
  
      dc = solt.core.DataContainer((i1, m1, m2, m3, m4, solt.core.KeyPoints(k, h, w), l1, l2, l3, l4, l5),
      'IMMMMPLLLLLL').
  
  
  Please note, that when you create DataContainer using such a simplified interface,
  you cannot setup the transform parameters per item. Use a proper constructor instead.
  
  Parameters
  ----------
  data : dict
      Data stored in a dictionary
  
  Returns
  -------
  out : sld.DataContainer
      Newly instantiated data container object
docstr_tok: ["Creates","a","data","container","from","a","dictionary",".","If","data","is","a","dict",",","then","the","``","solt.data.DataContainer","``","will","be","created","so","that","the","``","image","``","data","will","be","stored","first",".","Subsequently",",","multiple","images","under","the","key","``","images","``","will","be","stored",".","The","same","applies","to","masks","(","first","``","mask","``","and","then","``","masks","``",")",",","labels","(","``","label","``","and","``","labels","``",")",",","and","the","keypoints","(","``","keypoints","``","and","``","keypoints_array","``",")",".","You","must","use","``","solt.data.KeyPoints","``","object","here",".","Labels","will","always","be","stored","last",".","For","example",",","if","the","input","``","dict","``","looks","like","this",":","``","d","=","{","'label","'",":","l1",",","'image","'",":","i1",",","'mask","'",":","m1","}","``","or","``","d","=","{","'mask","'",":","m1",",","'image","'",":","i1",",","'label","'",":","l1","}","``",",","the","``","DataContainer","``","will","convert","this","into","``","sld.DataContainer","(","(","i1",",","m1",",","l1",")",",","'IML","'",")","``",".","More","complex","case",":","..","highlight",":",":","python","..","code-block",":",":","python","d","=","{","'image","'",":","i1",",","masks",":","(","m1",",","m2",",","m3",",","m4",")",",","'labels","'",":","(","l1",",","l2",",","l3",",","l4",",","l5",")",",","'keypoints","'",":","solt.core.KeyPoints","(","k",",","h",",","w",")","dc_from_dict","=","solt.core.DataContainer.from_dict","(","d",")","will","be","equivalent","to","..","highlight",":",":","python","..","code-block",":",":","python","dc","=","solt.core.DataContainer","(","(","i1",",","m1",",","m2",",","m3",",","m4",",","solt.core.KeyPoints","(","k",",","h",",","w",")",",","l1",",","l2",",","l3",",","l4",",","l5",")",",","'IMMMMPLLLLLL","'",")",".","Please","note",",","that","when","you","create","DataContainer","using","such","a","simplified","interface",",","you","can","not","setup","the","transform","parameters","per","item",".","Use","a","proper","constructor","instead",".","Parameters","--","--","--","--","--","data",":","dict","Data","stored","in","a","dictionary","Returns","--","--","--","-","out",":","sld.DataContainer","Newly","instantiated","data","container","object"]
code: def from_dict(data):
      """
      Creates a data container from a dictionary.
  
      If data is a dict, then the ``solt.data.DataContainer`` will be created so that the
      ``image`` data will be stored first. Subsequently, multiple images under the key ``images``
      will be stored. The same applies to masks (first ``mask`` and then ``masks``),
      labels (``label`` and ``labels``), and the keypoints (``keypoints`` and ``keypoints_array``).
      You must use ``solt.data.KeyPoints`` object here. Labels will always be stored last.
  
      For example, if the input ``dict`` looks like this: ``d = {'label': l1, 'image': i1, 'mask': m1}`` or
      ``d = {'mask': m1, 'image': i1, 'label': l1}``, the ``DataContainer`` will convert this
      into ``sld.DataContainer((i1, m1, l1), 'IML')``.
  
      More complex case:
  
      .. highlight:: python
      .. code-block:: python
  
          d = {'image': i1, masks: (m1, m2, m3, m4), 'labels': (l1, l2, l3, l4, l5),
          'keypoints': solt.core.KeyPoints(k, h, w)
          dc_from_dict = solt.core.DataContainer.from_dict(d)
  
      will be equivalent to
  
      .. highlight:: python
      .. code-block:: python
  
          dc = solt.core.DataContainer((i1, m1, m2, m3, m4, solt.core.KeyPoints(k, h, w), l1, l2, l3, l4, l5),
          'IMMMMPLLLLLL').
  
  
      Please note, that when you create DataContainer using such a simplified interface,
      you cannot setup the transform parameters per item. Use a proper constructor instead.
  
      Parameters
      ----------
      data : dict
          Data stored in a dictionary
  
      Returns
      -------
      out : sld.DataContainer
          Newly instantiated data container object
      """
      dc_content = []
      dc_format = []
      if "image" in data:
          dc_content.append(data["image"])
          dc_format.append("I")
      if "images" in data:
          dc_content.extend(data["images"])
          dc_format.extend("I" * len(data["images"]))
      if "mask" in data:
          dc_content.append(data["mask"])
          dc_format.append("M")
      if "masks" in data:
          dc_content.extend(data["masks"])
          dc_format.extend("M" * len(data["masks"]))
      if "keypoints" in data:
          dc_content.append(data["keypoints"])
          dc_format.append("P")
      if "keypoints_array" in data:
          dc_content.extend(data["keypoints_array"])
          dc_format.extend("P" * len(data["keypoints_array"]))
      if "label" in data:
          dc_content.append(data["label"])
          dc_format.append("L")
      if "labels" in data:
          dc_content.extend(data["labels"])
          dc_format.extend("L" * len(data["labels"]))
  
      return DataContainer(tuple(dc_content), "".join(dc_format))
  
imports: import numpy
  import torch
  from solt.constants import ALLOWED_INTERPOLATIONS, ALLOWED_PADDINGS, ALLOWED_TYPES
  from solt.utils import validate_parameter
label_desc: Use image node_id 6 for calling the DataContainer obj's underlying member method code with example usage: obj.from_dict(data) and returns: DataContainer