parameters: (self)
return_statement: return result
docstring: :return: One of the alternatives according to the given probabilities
docstring_summary: :return: One of the alternatives according to the given probabilities
docstring_tokens: : return : One of the alternatives according to the given probabilities
function: def generate(self):
          """
          :return: One of the alternatives according to the given probabilities
          """
          result = []
          cumulated_probability = 0
          p = random.random()
          for possibility in self.possibilities:
              cumulated_probability += float(possibility[0])
              if p <= cumulated_probability:
                  result.extend(self.generate_multiple(possibility[1]))
                  break
          return result
function_tokens: def generate ( self ) : result = [ ] cumulated_probability = 0 p = random . random ( ) for possibility in self . possibilities : cumulated_probability += float ( possibility [ 0 ] ) if p <= cumulated_probability : result . extend ( self . generate_multiple ( possibility [ 1 ] ) ) break return result