rewriting pull request in the form of an if statement to skip HEAD when generating sphinx docs