def filter_between_tags(self, all_tags):
tag_names = [t["<STR_LIT:name>"] for t in all_tags]<EOL>between_tags = []<EOL>for tag in self.options.between_tags:<EOL><INDENT>try:<EOL><INDENT>idx = tag_names.index(tag)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ChangelogGeneratorError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(tag))<EOL><DEDENT>between_tags.append(all_tags[idx])<EOL><DEDENT>between_tags = self.sort_tags_by_date(between_tags)<EOL>if len(between_tags) == <NUM_LIT:1>:<EOL><INDENT>between_tags.append(between_tags[<NUM_LIT:0>])<EOL><DEDENT>older = self.get_time_of_tag(between_tags[<NUM_LIT:1>])<EOL>newer = self.get_time_of_tag(between_tags[<NUM_LIT:0>])<EOL>for tag in all_tags:<EOL><INDENT>if older < self.get_time_of_tag(tag) < newer:<EOL><INDENT>between_tags.append(tag)<EOL><DEDENT><DEDENT>if older == newer:<EOL><INDENT>between_tags.pop(<NUM_LIT:0>)<EOL><DEDENT>return between_tags<EOL>
Filter tags according between_tags option.

:param list(dict) all_tags: Pre-filtered tags.
:rtype: list(dict)
:return: Filtered tags.