<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def enable(cls, user_id, github_id, name, hook):
 """Enable webhooks for a repository. If the repository does not exist it will create one. :param user_id: User identifier. :param repo_id: GitHub repository identifier. :param name: Fully qualified name of the repository. :param hook: GitHub hook identifier. """

        try:
            repo = cls.get(user_id, github_id=github_id, name=name)
        except NoResultFound:
            repo = cls.create(user_id=user_id, github_id=github_id, name=name)
        repo.hook = hook
        repo.user_id = user_id
        return repo