docs: def __setitem(self, chunk, key, keys, value, extend=False):
          """Helper function to fill up the dictionary."""
          def setitem(chunk):
              if keys:
                  return self.__setitem(chunk, keys[0], keys[1:], value, extend)
              else:
                  return value
  
          if key in ['.', ']']:
              chunk[key] = value
          elif ']' in key:  # list
              key = int(key[:-1].replace('n', '-1'))
              if extend:
                  if chunk is None:
                      chunk = [None, ]
                  else:
                      if not isinstance(chunk, list):
                          chunk = [chunk, ]
                      if key != -1:
                          chunk.insert(key, None)
                      else:
                          chunk.append(None)
              else:
                  if chunk is None:
                      chunk = [None, ]
              chunk[key] = setitem(chunk[key])
          else:  # dict
              if extend:
                  if chunk is None:
                      chunk = {}
                      chunk[key] = None
                      chunk[key] = setitem(chunk[key])
                  elif key not in chunk:
                      chunk[key] = None
                      chunk[key] = setitem(chunk[key])
                  else:
                      if keys:
                          chunk[key] = setitem(chunk[key])
                      else:
                          if not isinstance(chunk[key], list):
                              chunk[key] = [chunk[key], ]
                          chunk[key].append(None)
                          chunk[key][-1] = setitem(chunk[key][-1])
              else:
                  if chunk is None:
                      chunk = {}
                  if key not in chunk:
                      chunk[key] = None
                  chunk[key] = setitem(chunk[key])
  
          return chunk