:calls: `GET /orgs/:owner/hooks/:id <http://developer.github.com/v3/orgs/hooks>`_
        :param id: integer
        :rtype: :class:`github.Hook.Hook`
962493
def get_hook(self, id):
        
        assert isinstance(id, (int, long)), id
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/hooks/" + str(id)
        )
        return github.Hook.Hook(self._requester, headers, data, completed=True)
1361183
def detect_hooks():
    
    flog.debug('Detecting hooks ...')
    present = any([hasattr(hook, 'RENAMER') for hook in sys.meta_path])
    if present:
        flog.debug('Detected.')
    else:
        flog.debug('Not detected.')
    return present
1252726
def get(self, dash_id):
        
        return make_response(render_template('dashboard.html', dash_id=dash_id, api_root=config.app_host))
1017056
def get_hook(hook_name):
    
    if not pkg_resources.resource_exists(__name__, hook_name):
        raise HookNotFoundError
    return pkg_resources.resource_string(__name__, hook_name)
1316107
def _get_context_key(self, **kwargs):
        
        return str(kwargs.get(self._resource.parent.id_name))
1202627
def sync_repo_hook(self, repo_id):
        """"""
        # Get the hook that we may have set in the past
        gh_repo = self.api.repository_with_id(repo_id)
        hooks = (hook.id for hook in gh_repo.hooks()
                 if hook.config.get('url', '') == self.webhook_url)
        hook_id = next(hooks, None)

        # If hook on GitHub exists, get or create corresponding db object and
        # enable the hook. Otherwise remove the old hook information.
        if hook_id:
            Repository.enable(user_id=self.user_id,
                              github_id=gh_repo.id,
                              name=gh_repo.full_name,
                              hook=hook_id)
        else:
            Repository.disable(user_id=self.user_id,
                               github_id=gh_repo.id,
                               name=gh_repo.full_name)
1330386
def get(self, id=None, **kwargs):
        
        if id is not None:
            return self._get('components/%s' % id, data=kwargs)
        elif 'params' in kwargs:
            data = dict(kwargs)
            params = data.pop('params')
            return self._get('components', data=data, params=params)
        else:
            return self._get('components', data=kwargs)
370864
public final function hook($hookId, callable $callback = null)
	{
		if (null === $callback) {
			//触发
			if (isset($this->hooks[$hookId])) {
				return ($this->hooks[$hookId])($this);
			}
		} else {
			//绑定
			$id = 1;
			while ($hookId > 0) {
				if ($hookId & 1 == 1) {
					$this->hooks[$id] = $callback;
				}
				$id *= 2;
				$hookId >>= 1;
			}
		}
	}
1051772
def get_key(self, id):
        
        assert isinstance(id, (int, long)), id
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            "/user/keys/" + str(id)
        )
        return github.UserKey.UserKey(self._requester, headers, data, completed=True)
713244
def hook_point(self, hook_name):
        
        self.my_daemon.hook_point(hook_name=hook_name, handle=self)
1275778
def get_notification(self, id):
        

        assert isinstance(id, (str, unicode)), id
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            "/notifications/threads/" + id
        )
        return github.Notification.Notification(self._requester, headers, data, completed=True)
168728
def _handle_id(self, node, scope, ctxt, stream):
        
        if node.name == "__root":
            return self._root
        if node.name == "__this" or node.name == "this":
            return ctxt

        self._dlog("handling id {}".format(node.name))
        field = scope.get_id(node.name)

        is_lazy = getattr(node, "is_lazy", False)

        if field is None and not is_lazy:
            raise errors.UnresolvedID(node.coord, node.name)
        elif is_lazy:
            return LazyField(node.name, scope)

        return field
1071423
def find(id)
      raise ArgumentError.new("Missing id/slug") unless id

      result = access_token.get("#{API_BASE}#{self.class::API_PATH}#{id}")
      raise ServiceError.new(result.code, result.body) unless result.code == "200"

      self.class::ITEM_CLASS.new(result.body)
    end
1215885
def create_hook(self, repo_id, repo_name):
        """"""
        config = dict(
            url=self.webhook_url,
            content_type='json',
            secret=current_app.config['GITHUB_SHARED_SECRET'],
            insecure_ssl='1' if current_app.config['GITHUB_INSECURE_SSL']
                         else '0',
        )

        ghrepo = self.api.repository_with_id(repo_id)
        if ghrepo:
            try:
                hook = ghrepo.create_hook(
                    'web',  # GitHub identifier for webhook service
                    config,
                    events=['release'],
                )
            except github3.GitHubError as e:
                # Check if hook is already installed
                hook_errors = (m for m in e.errors
                               if m['code'] == 'custom' and
                               m['resource'] == 'Hook')
                if next(hook_errors, None):
                    hooks = (h for h in ghrepo.hooks()
                             if h.config.get('url', '') == config['url'])
                    hook = next(hooks, None)
                    if hook:
                        hook.edit(config=config, events=['release'])
            finally:
                if hook:
                    Repository.enable(user_id=self.user_id,
                                      github_id=repo_id,
                                      name=repo_name,
                                      hook=hook.id)
                    return True
        return False
161317
public function getSingleHook(int $id): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
    }
204585
def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet):
        
        assert isinstance(name, (str, unicode)), name
        assert isinstance(config, dict), config
        assert events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events
        assert active is github.GithubObject.NotSet or isinstance(active, bool), active
        post_parameters = {
            "name": name,
            "config": config,
        }
        if events is not github.GithubObject.NotSet:
            post_parameters["events"] = events
        if active is not github.GithubObject.NotSet:
            post_parameters["active"] = active
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            self.url + "/hooks",
            input=post_parameters
        )
        return github.Hook.Hook(self._requester, headers, data, completed=True)
190317
def run_hook(self, hook, *args, **kwargs):
        
        for plugin in self.raw_plugins:
            if hasattr(plugin, hook):
                self.logger.debug('Calling hook {0} in plugin {1}'.format(hook, plugin.__name__))
                getattr(plugin, hook)(*args, **kwargs)