13e5fb6abb1223e377886469e48945477a7fcf28,rasa_core/training/structures.py,Story,as_story_string,#Story#Any#,190

Before Change


        return Dialogue(sender_id, events)

    def as_story_string(self, flat=False):
        story_content = ""
        for step in self.story_steps:
            story_content += step.as_story_string(flat)

        if flat:
            if self.story_name:
                name = self.story_name
            else:
                name = "Generated Story {}".format(hash(story_content))
            return "//// {}\n{}".format(name, story_content)
        else:
            return story_content

    def dump_to_file(self, filename, flat=False):

After Change


    def __init__(self, story_steps, story_end_checkpoints=None):
        // type: (List[StoryStep], Optional[Dict[Text, Text]]) -> None
        self.story_steps = story_steps
        self.step_lookup = {s.id: s for s in self.story_steps}
        ordered_ids, cyclic_edges = StoryGraph.order_steps(story_steps)
        self.ordered_ids = ordered_ids
        self.cyclic_edge_ids = cyclic_edges
        if story_end_checkpoints:
            self.story_end_checkpoints = story_end_checkpoints
        else:
            self.story_end_checkpoints = {}

    def ordered_steps(self):
        // type: () -> List[StoryStep]
        Returns the story steps ordered by topological order of the DAG."""

        return [self.get(step_id) for step_id in self.ordered_ids]

    def cyclic_edges(self):
        // type: () -> List[Tuple[Optional[StoryStep], Optional[StoryStep]]]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: RasaHQ/rasa
Commit Name: 13e5fb6abb1223e377886469e48945477a7fcf28
Time: 2018-10-23
Author: alan@golastmile.com
File Name: rasa_core/training/structures.py
Class Name: Story
Method Name: as_story_string


Project Name: arraiy/torchgeometry
Commit Name: 73317ca61e33b42353fc4b3010f586124954ca18
Time: 2019-12-19
Author: diegovd0296@gmail.com
File Name: examples/data_augmentation.py
Class Name: DummyDataset
Method Name: __getitem__


Project Name: RasaHQ/rasa
Commit Name: 13e5fb6abb1223e377886469e48945477a7fcf28
Time: 2018-10-23
Author: alan@golastmile.com
File Name: rasa_core/training/structures.py
Class Name: Story
Method Name: as_story_string


Project Name: arraiy/torchgeometry
Commit Name: dcd394f4a5bddb1fc97ae4a7224e00147fc110a3
Time: 2020-01-15
Author: diegovd0296@gmail.com
File Name: examples/data_augmentation.py
Class Name: DummyDataset
Method Name: __getitem__