class_docstr: Helper base class for the :class:`Domain` and :class:`Sample` classes.
  
  It implements common logic for creation, representation, type conversion
  and serialisation.
class_docstr_tok: ["Helper","base","class","for","the",":","class",":","`","Domain","`","and",":","class",":","`","Sample","`","classes",".","It","implements","common","logic","for","creation",",","representation",",","type","conversion","and","serialisation","."]
code: def __init__(self, dct):
      if isinstance(dct, dict):
          self._data = dct
      elif isinstance(dct, str):
          self._data = ast.literal_eval(dct)
      else:
          raise TypeError(
              f"A {self.__class__.__name__} object can be created from a "
              f"Python dict or str objects only. "
              f"Unknown type {type(dct)} at initialisation."
          )
  
      self._ndim = 0
      for _, val in _deepiter_dict(self._data):
          self._ndim += 1
  
imports: import ast
  import copy
  import os
  import pickle
  import random
  from collections import namedtuple
  from typing import Tuple
label_desc: Use image node_id 1 to create a new _RecursiveDict object  with example: obj = _RecursiveDict(dct)