<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_graph(self, tags):
 """Builds a graph from the entities included in the tags. Note this is used internally. Args: tags (list):
 A list of the tags to include in graph Returns: graph : this is the resulting graph of the tagged entities. """

        graph = SimpleGraph()
        for tag_index in xrange(len(tags)):
            for entity_index in xrange(len(tags[tag_index].get('entities'))):
                a_entity_name = graph_key_from_tag(tags[tag_index], entity_index)
                tokens = self.tokenizer.tokenize(tags[tag_index].get('entities', [])[entity_index].get('match'))
                for tag in tags[tag_index + 1:]:
                    start_token = tag.get('start_token')
                    if start_token >= tags[tag_index].get('start_token') + len(tokens):
                        for b_entity_index in xrange(len(tag.get('entities'))):
                            b_entity_name = graph_key_from_tag(tag, b_entity_index)
                            graph.add_edge(a_entity_name, b_entity_name)

        return graph