def get_stories(f, only_supporting=False, max_length=None):
    data = parse_stories(f.readlines(), only_supporting=only_supporting)
    flatten = lambda data: reduce(lambda x, y: x + y, data)
    data = [(flatten(story), q, answer) for story, q, answer in data if not max_length or len(flatten(story)) < max_length]
    return data
Test whether a proper dependency tree generated the correct output.
dataset/ETHPy150Open fchollet/keras/examples/babi_rnn.py/get_stories--crossover with--dataset/ETHPy150Open toumorokoshi/sprinter/sprinter/core/tests/test_manifest.py/TestManifest.test_dependency_order