code: def scenarios(self, generate_seed=False):
          seed = prime_numbers(1000)
          sweeps_all = self.experiment["sweeps"].keys()
          if "combinations" in self.experiment:
              if isinstance(self.experiment["combinations"], list):
                  combinations_in_experiment = {" ": self.experiment["combinations"]}
              else:
                  combinations_in_experiment = self.experiment["combinations"]
          else:
              combinations_in_experiment = dict()
          all_combinations_sweeps = []
          all_combinations = []
          for key, combinations_ in combinations_in_experiment.items():
              if not combinations_:
                  combinations_sweeps = []
                  combinations = [[]]
              else:
                  combinations_sweeps = combinations_[0]
                  combinations = combinations_[1:]
              for item in combinations_sweeps:
                  all_combinations_sweeps.append(item)
              all_combinations.append((combinations_sweeps, combinations))
          sweeps_fully_factorial = list(set(sweeps_all) - set(all_combinations_sweeps))
          for sweep in sweeps_fully_factorial:
              all_combinations.append(([sweep], [[x] for x in self.experiment["sweeps"][sweep].keys()]))
          red_iter = 0
          while len(all_combinations) > 1:
              comb1 = all_combinations[0]
              comb2 = all_combinations[1]
              new_sweeps = comb1[0] + comb2[0]
              new_combinations = [x+y for x in comb1[1] for y in comb2[1]]
              all_combinations = [(new_sweeps, new_combinations)] + all_combinations[2:]
              red_iter += 1
          sweep_names = all_combinations[0][0]
          combinations = all_combinations[0][1]
          for combination in combinations:
              scenario = Scenario(self._apply_combination(self.experiment["base"], sweep_names, combination))
              scenario.parameters = dict(zip(sweep_names, combination))
              if generate_seed:
                  if "@seed@" in scenario.xml:
                      scenario.xml = scenario.xml.replace("@seed@", str(next(seed)))
                  else:
                      raise(RuntimeError("@seed@ placeholder is not found"))
              yield scenario