def _sub_expand(self, tags):
entities = {}<EOL>graph = self._build_graph(tags)<EOL>for tag in tags:<EOL><INDENT>for entity_index in xrange(len(tag.get('<STR_LIT>'))):<EOL><INDENT>node_name = graph_key_from_tag(tag, entity_index)<EOL>if not node_name in entities:<EOL><INDENT>entities[node_name] = []<EOL><DEDENT>entities[node_name] += [<EOL>tag.get('<STR_LIT>', [])[entity_index],<EOL>tag.get('<STR_LIT>', [])[entity_index].get('<STR_LIT>'),<EOL>tag<EOL>]<EOL><DEDENT><DEDENT>for clique in get_cliques(list(entities), graph):<EOL><INDENT>result = []<EOL>for entity_name in clique:<EOL><INDENT>start_token = int(entity_name.split("<STR_LIT:->")[<NUM_LIT:0>])<EOL>old_tag = entities[entity_name][<NUM_LIT:2>]<EOL>tag = {<EOL>'<STR_LIT>': start_token,<EOL>'<STR_LIT>': [entities.get(entity_name)[<NUM_LIT:0>]],<EOL>'<STR_LIT>': entities.get(entity_name)[<NUM_LIT:1>] * old_tag.get('<STR_LIT>', <NUM_LIT:1.0>),<EOL>'<STR_LIT>': old_tag.get('<STR_LIT>'),<EOL>'<STR_LIT>': old_tag.get('<STR_LIT>')[<NUM_LIT:0>].get('<STR_LIT>'),<EOL>'<STR_LIT:key>': old_tag.get('<STR_LIT>')[<NUM_LIT:0>].get('<STR_LIT:key>'),<EOL>'<STR_LIT>': old_tag.get('<STR_LIT>', False)<EOL>}<EOL>result.append(tag)<EOL><DEDENT>result = sorted(result, key=lambda e: e.get('<STR_LIT>'))<EOL>yield result<EOL><DEDENT>
This called by expand to find cliques

        Args:
            tags (list): a list of the tags used to get cliques

        Yields:
            list : list of sorted tags by start_token this is a clique