code: def get_travis_branch():
      
      if os.environ.get("TRAVIS_PULL_REQUEST", "") == "true":
          return os.environ.get("TRAVIS_PULL_REQUEST_BRANCH", "")
      else:
          return os.environ.get("TRAVIS_BRANCH", "")
docs: Get the name of the branch that the PR is from.
  
      Note that this is not simply ``$TRAVIS_BRANCH``. the ``push`` build will
      use the correct branch (the branch that the PR is from) but the ``pr``
      build will use the _target_ of the PR (usually master). So instead, we ask
      for ``$TRAVIS_PULL_REQUEST_BRANCH`` if it's a PR build, and
      ``$TRAVIS_BRANCH`` if it's a push build.