def reuse_dist_file(filename):
<EOL>if not os.path.isfile(filename):<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>import git<EOL><DEDENT>except ImportError:<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>git.Repo().tags<EOL><DEDENT>except (TypeError, git.GitError):<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>
Returns `True` if a distribution file can be reused

    Otherwise it should be regenerated