def METHOD_NAME(self, repo, start_sha, end_sha, actor=None):
    if actor is None:
        raise NotImplementedError("Cannot fetch commits anonymously")
    client = self.get_client(actor)
    # use config name because that is kept in sync via webhooks
    name = repo.config["name"]
    if start_sha is None:
        try:
            res = client.get_last_commits(name, end_sha)
        except Exception as e:
            self.raise_error(e, identity=client.auth)
        else:
            return self._format_commits(repo, res[:10])
    else:
        try:
            res = client.METHOD_NAME(name, start_sha, end_sha)
        except Exception as e:
            self.raise_error(e, identity=client.auth)
        else:
            return self._format_commits(repo, res)