code: def determine_push_rights(*, branch_whitelist, TRAVIS_BRANCH,
      TRAVIS_PULL_REQUEST, TRAVIS_TAG, build_tags, fork):
      
      canpush = True
  
      if TRAVIS_TAG:
          if not build_tags:
              print("The docs are not pushed on tag builds. To push on future tag builds, use --build-tags")
          return build_tags
  
      if not any([re.compile(x).match(TRAVIS_BRANCH) for x in branch_whitelist]):
          print("The docs are only pushed to gh-pages from master. To allow pushing from "
          "a non-master branch, use the --no-require-master flag", file=sys.stderr)
          print("This is the {TRAVIS_BRANCH} branch".format(TRAVIS_BRANCH=TRAVIS_BRANCH), file=sys.stderr)
          canpush = False
  
      if TRAVIS_PULL_REQUEST != "false":
          print("The website and docs are not pushed to gh-pages on pull requests", file=sys.stderr)
          canpush = False
  
      if fork:
          print("The website and docs are not pushed to gh-pages on fork builds.", file=sys.stderr)
          canpush = False
  
      if last_commit_by_doctr():
          print(red("The last commit on this branch was pushed by doctr. Not pushing to "
          "avoid an infinite build-loop."), file=sys.stderr)
          canpush = False
  
      return canpush
docs: Check if Travis is running on ``master`` (or a whitelisted branch) to
      determine if we can/should push the docs to the deploy repo