def check_tags(repos, tags, ignore_existing=False, fail_fast=False):
debug("<STR_LIT>".format(n=len(tags)))<EOL>[debug("<STR_LIT>".format(t=t)) for t in tags]<EOL>debug("<STR_LIT>".format(n=len(repos)))<EOL>[debug("<STR_LIT>".format(r=r.full_name)) for r in repos]<EOL>present_tags = {}<EOL>absent_tags = {}<EOL>problems = []<EOL>for r in repos:<EOL><INDENT>has_tags = find_tags_in_repo(r, tags)<EOL>if has_tags:<EOL><INDENT>if not ignore_existing:<EOL><INDENT>yikes = GitTagExistsError(<EOL>"<STR_LIT>".format(<EOL>tag=list(has_tags.keys()),<EOL>r=r.full_name<EOL>))<EOL>if fail_fast:<EOL><INDENT>raise yikes<EOL><DEDENT>problems.append(yikes)<EOL>error(yikes)<EOL><DEDENT>present_tags[r.full_name] = {<EOL>'<STR_LIT>': r,<EOL>'<STR_LIT>': list(has_tags.values()),<EOL>}<EOL><DEDENT>missing_tags = [x for x in tags if x not in has_tags]<EOL>if missing_tags:<EOL><INDENT>absent_tags[r.full_name] = {<EOL>'<STR_LIT>': r,<EOL>'<STR_LIT>': missing_tags,<EOL>}<EOL><DEDENT><DEDENT>debug(textwrap.dedent("""<STR_LIT>""").format(<EOL>n_with=len(present_tags),<EOL>n_none=len(absent_tags),<EOL>errors=len(problems),<EOL>))<EOL>return present_tags, absent_tags, problems<EOL>
check if tags already exist in repos