code: def serialize_to_nested(self, name, datas):
          
          keys = datas.get('keys', None)
          splitter = datas.get('splitter', self._DEFAULT_SPLITTER)
  
          if not keys:
              msg = ("Nested reference '{}' lacks of required 'keys' variable "
                     "or is empty")
              raise SerializerError(msg.format(name))
          else:
              keys = self.value_splitter(name, 'keys', keys, mode=splitter)
  
          # Initialize context dict with reference keys
          context = OrderedDict()
          for k in keys:
              context[k] = OrderedDict()
  
          # Tidy each variable value to its respective item
          for k, v in datas.items():
              # Ignore reserved internal keywords
              if k not in ('keys', 'structure', 'splitter'):
                  values = self.value_splitter(name, 'values', v, mode=splitter)
  
                  if len(values) != len(keys):
                      msg = ("Nested reference '{}' has different length for "
                             "values of '{}' and 'keys'")
                      raise SerializerError(msg.format(name, k))
  
                  # Put each value to its respective key using position index.
                  for i, item in enumerate(values):
                      ref = keys[i]
                      context[ref][k] = item
  
          return context
docs: Serialize given datas to a nested structure where each key create an
          item and each other variable is stored as a subitem with corresponding
          value (according to key index position).
  
          Arguments:
              name (string): Name only used inside possible exception message.
              datas (dict): Datas to serialize.
  
          Returns:
              dict: Nested dictionnary of serialized reference datas.