<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addprojecthook(self, project_id, url, push=False, issues=False, merge_requests=False, tag_push=False):
 """ add a hook to a project :param project_id: project id :param url: url of the hook :return: True if success """

        data = {
            'id': project_id,
            'url': url,
            'push_events': int(bool(push)),
            'issues_events': int(bool(issues)),
            'merge_requests_events': int(bool(merge_requests)),
            'tag_push_events': int(bool(tag_push)),
        }

        request = requests.post(
            '{0}/{1}/hooks'.format(self.projects_url, project_id),
            headers=self.headers, data=data, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return request.json()
        else:
            return False