def _flat_sample_distributions(self, sample_shape=(), seed=None, value=None):
ds = []<EOL>values_out = []<EOL>seed = seed_stream.SeedStream('<STR_LIT>', seed)<EOL>gen = self._model()<EOL>index = <NUM_LIT:0><EOL>d = next(gen)<EOL>try:<EOL><INDENT>while True:<EOL><INDENT>actual_distribution = d.distribution if isinstance(d, self.Root) else d<EOL>ds.append(actual_distribution)<EOL>if (value is not None and len(value) > index and<EOL>value[index] is not None):<EOL><INDENT>seed()<EOL>next_value = value[index]<EOL><DEDENT>else:<EOL><INDENT>next_value = actual_distribution.sample(<EOL>sample_shape=sample_shape if isinstance(d, self.Root) else (),<EOL>seed=seed())<EOL><DEDENT>values_out.append(next_value)<EOL>index += <NUM_LIT:1><EOL>d = gen.send(next_value)<EOL><DEDENT><DEDENT>except StopIteration:<EOL><INDENT>pass<EOL><DEDENT>return ds, values_out<EOL>
Executes `model`, creating both samples and distributions.