code: def is_empty_branch(self, repo, base_branch, new_branch, prefix):
          
          # extra safeguard to make sure we are handling a bot branch here
          assert new_branch.startswith(prefix)
          comp = repo.compare(base_branch, new_branch)
          logger.info("Got a total of {} commits in {}".format(comp.total_commits, new_branch))
          return comp.total_commits == 0
docs: Compares the top commits of two branches.
          Please note: This function isn't checking if `base_branch` is a direct
          parent of `new_branch`, see
          http://stackoverflow.com/questions/3161204/find-the-parent-branch-of-a-git-branch
          :param repo: github.Repository
          :param base_branch: string name of the base branch
          :param new_branch: string name of the new branch
          :param prefix: string branch prefix, default 'pyup-'
          :return: bool -- True if empty