<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_hook(self, repo_id, name):
 """Remove repository hook."""

        ghrepo = self.api.repository_with_id(repo_id)
        if ghrepo:
            hooks = (h for h in ghrepo.hooks()
                     if h.config.get('url', '') == self.webhook_url)
            hook = next(hooks, None)
            if not hook or hook.delete():
                Repository.disable(user_id=self.user_id,
                                   github_id=repo_id,
                                   name=name)
                return True
        return False