docs: def variable_matrix(
      variables: VarType, parent: str = None, iterator: str = "product"
  ) -> Iterable[Dict[str, YamlValue]]:
      """Process the variables into a list of the appropriate combinations.
  
      This function performs recursive processing of the input variables, creating an
      iterator which has all the combinations of variables specified in the input.
  
      """
      _iters: Dict[str, Callable] = {"product": product, "zip": zip}
      _special_keys: Dict[str, Callable[[VarType, Any], Iterable[VarMatrix]]] = {
          "zip": iterator_zip,
          "product": iterator_product,
          "arange": iterator_arange,
          "chain": iterator_chain,
          "append": iterator_chain,
          "cycle": iterator_cycle,
          "repeat": iterator_cycle,
      }
  
      if isinstance(variables, dict):
          key_vars: List[List[Dict[str, YamlValue]]] = []
  
          # Handling of specialised iterators
          for key, function in _special_keys.items():
              if variables.get(key):
                  item = variables[key]
                  assert item is not None
                  for val in function(item, parent):
                      key_vars.append(val)
  
                  del variables[key]
  
          for key, value in variables.items():
              key_vars.append(list(variable_matrix(value, key, iterator)))
  
          logger.debug("key vars: %s", key_vars)
  
          # Iterate through all possible products generating a dictionary
          for i in _iters[iterator](*key_vars):
              logger.debug("dicts: %s", i)
              yield combine_dictionaries(i)
  
      # Iterate through a list of values
      elif isinstance(variables, list):
          for item in variables:
              yield from variable_matrix(item, parent, iterator)
  
      # Stopping condition -> we have either a single value from a list
      # or a value had only one item
      else:
          assert parent is not None
          yield {parent: variables}