code: def _create_lists(config, results, current, stack, inside_cartesian=None):
      
      # Have we done it already?
      try:
          return results[current]
      except KeyError:
          pass
      # Check recursion depth and detect loops
      if current in stack:
          raise ConfigurationError('Rule {!r} is recursive: {!r}'.format(stack[0], stack))
      if len(stack) > 99:
          raise ConfigurationError('Rule {!r} is too deep'.format(stack[0]))
      # Track recursion depth
      stack.append(current)
      try:
          # Check what kind of list we have
          listdef = config[current]
          list_type = listdef[_CONF.FIELD.TYPE]
          # 1. List of words
          if list_type == _CONF.TYPE.WORDS:
              results[current] = WordList(listdef['words'])
          # List of phrases
          elif list_type == _CONF.TYPE.PHRASES:
              results[current] = PhraseList(listdef['phrases'])
          # 2. Simple list of lists
          elif list_type == _CONF.TYPE.NESTED:
              results[current] = NestedList([_create_lists(config, results, x, stack,
                                                           inside_cartesian=inside_cartesian)
                                             for x in listdef[_CONF.FIELD.LISTS]])
  
          # 3. Cartesian list of lists
          elif list_type == _CONF.TYPE.CARTESIAN:
              if inside_cartesian is not None:
                  raise ConfigurationError("Cartesian list {!r} contains another Cartesian list "
                                           "{!r}. Nested Cartesian lists are not allowed."
                                           .format(inside_cartesian, current))
              results[current] = CartesianList([_create_lists(config, results, x, stack,
                                                              inside_cartesian=current)
                                                for x in listdef[_CONF.FIELD.LISTS]])
          # 4. Scalar
          elif list_type == _CONF.TYPE.CONST:
              results[current] = Scalar(listdef[_CONF.FIELD.VALUE])
          # Unknown type
          else:
              raise InitializationError("Unknown list type: {!r}".format(list_type))
          # Return the result
          return results[current]
      finally:
          stack.pop()
docs: An ugly recursive method to transform config dict
      into a tree of AbstractNestedList.