def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet):
assert isinstance(name, (str, unicode)), name<EOL>assert isinstance(config, dict), config<EOL>assert events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events<EOL>assert active is github.GithubObject.NotSet or isinstance(active, bool), active<EOL>post_parameters = {<EOL>"<STR_LIT:name>": name,<EOL>"<STR_LIT>": config,<EOL>}<EOL>if events is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"] = events<EOL><DEDENT>if active is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"] = active<EOL><DEDENT>headers, data = self._requester.requestJsonAndCheck(<EOL>"<STR_LIT:POST>",<EOL>self.url + "<STR_LIT>",<EOL>input=post_parameters<EOL>)<EOL>return github.Hook.Hook(self._requester, headers, data, completed=True)<EOL>
:calls: `POST /orgs/:owner/hooks <http://developer.github.com/v3/orgs/hooks>`_
:param name: string
:param config: dict
:param events: list of string
:param active: bool
:rtype: :class:`github.Hook.Hook`