def check_existing_git_tag(repo, t_tag, **kwargs):
assert isinstance(repo, github.Repository.Repository), type(repo)<EOL>assert isinstance(t_tag, codekit.pygithub.TargetTag), type(t_tag)<EOL>debug("<STR_LIT>".format(<EOL>repo=repo.full_name,<EOL>tag=t_tag.name,<EOL>))<EOL>e_ref = pygithub.find_tag_by_name(repo, t_tag.name)<EOL>if not e_ref:<EOL><INDENT>debug("<STR_LIT>".format(tag=t_tag.name))<EOL>return False<EOL><DEDENT>try:<EOL><INDENT>e_tag = repo.get_git_tag(e_ref.object.sha)<EOL><DEDENT>except github.RateLimitExceededException:<EOL><INDENT>raise<EOL><DEDENT>except github.GithubException as e:<EOL><INDENT>msg = "<STR_LIT>".format(<EOL>tag=e_tag.tag,<EOL>sha=e_tag.sha,<EOL>)<EOL>raise pygithub.CaughtRepositoryError(repo, e, msg) from None<EOL><DEDENT>debug("<STR_LIT>".format(<EOL>tag=e_tag.tag,<EOL>sha=e_tag.sha,<EOL>))<EOL>if cmp_existing_git_tag(t_tag, e_tag, **kwargs):<EOL><INDENT>return True<EOL><DEDENT>yikes = GitTagExistsError(textwrap.dedent("""<STR_LIT>""").format(<EOL>tag=t_tag.name,<EOL>repo=repo.full_name,<EOL>e_sha=e_tag.object.sha,<EOL>e_message=e_tag.message,<EOL>e_tagger=e_tag.tagger,<EOL>t_sha=t_tag.sha,<EOL>t_message=t_tag.message,<EOL>t_tagger=t_tag.tagger,<EOL>))<EOL>raise yikes<EOL>
Check for a pre-existng tag in the github repo.

Parameters
----------
repo : github.Repository.Repository
    repo to inspect for an existing tagsdf
t_tag: codekit.pygithub.TargetTag
    dict repesenting a target git tag

Returns
-------
insync : `bool`
    True if tag exists and is in sync. False if tag does not exist.

Raises
------
GitTagExistsError
    If tag exists but is not in sync.