Wrapper round the require_capability funciton that automatically passes in the quiz context.
774868
public function require_capability($capability, $userid = null, $doanything = true) {
        return require_capability($capability, $this->context, $userid, $doanything);
    }
203873
async def capability_check(self, optional=None, required=None):
        """"""

        self._check_receive_loop()
        # If the returned response is an error, self.query will raise an error
        await self.query(
            "version", {"optional": optional or [], "required": required or []}
        )
700070
def requires_loaded(func):
        
        def _wrapper(self, *args, **kwargs):
            # If we don't have data, go load it.
            if self._loaded_data is None:
                self._loaded_data = self.loader.load(self.service_name)

            return func(self, *args, **kwargs)

        return _wrapper
599570
private Capability[] getCapabilities(String addDrop, TestContext context) {
        String[] capabilities = StringUtils.commaDelimitedListToStringArray(getParameter(addDrop, context));
        Capability[] capAdd = new Capability[capabilities.length];

        for (int i = 0; i < capabilities.length; i++) {
            capAdd[i] = Capability.valueOf(capabilities[i]);
        }

        return capAdd;
    }
713915
def capability_functions(self, fn):
        """"""
        if _debug: Collector._debug("capability_functions %r", fn)

        # build a list of functions to call
        fns = []
        for cls in self.capabilities:
            xfn = getattr(cls, fn, None)
            if _debug: Collector._debug("    - cls, xfn: %r, %r", cls, xfn)
            if xfn:
                fns.append( (getattr(cls, '_zindex', None), xfn) )

        # sort them by z-index
        fns.sort(key=lambda v: v[0])
        if _debug: Collector._debug("    - fns: %r", fns)

        # now yield them in order
        for xindx, xfn in fns:
            if _debug: Collector._debug("    - yield xfn: %r", xfn)
            yield xfn
752981
def default_capability(self):
        
        if ('capability' not in self.md and self.capability_name is not None):
            self.md['capability'] = self.capability_name
984077
def matches(self, requirement):
    """"""
    try:
      requirement = self.parse_requirement(requirement, self._interpreter)
    except ValueError as e:
      raise self.UnknownRequirement(str(e))
    return self.distribution in requirement
1181965
def capability(cap_name, *args)
      cap_mod = capability_module(cap_name.to_sym)
      if !cap_mod
        raise Errors::CapabilityNotFound,
          cap:  cap_name.to_s,
          host: @cap_host_chain[0][0].to_s
      end

      cap_method = nil
      begin
        cap_method = cap_mod.method(cap_name)
      rescue NameError
        raise Errors::CapabilityInvalid,
          cap: cap_name.to_s,
          host: @cap_host_chain[0][0].to_s
      end

      args = @cap_args + args
      @cap_logger.info(
        "Execute capability: #{cap_name} #{args.inspect} (#{@cap_host_chain[0][0]})")
      cap_method.call(*args)
    end
446980
def get_capability(self, capability_name):
        
        try:
            capability = self._current_application().capabilities[capability_name]
        except Exception as e:
            raise e
        return capability
1037750
def add_capability(self, cls):
        """"""
        if _debug: Collector._debug("add_capability %r", cls)

        # the new type has everything the current one has plus this new one
        bases = (self.__class__, cls)
        if _debug: Collector._debug("    - bases: %r", bases)

        # save this additional class
        self.capabilities.append(cls)

        # morph into a new type
        newtype = type(self.__class__.__name__ + '+' + cls.__name__, bases, {})
        self.__class__ = newtype

        # allow the new type to init
        if hasattr(cls, '__init__'):
            if _debug: Collector._debug("    - calling %r.__init__", cls)
            cls.__init__(self)
884633
def requires_authentication(func):
        
        def _auth(self, *args, **kwargs):
            if not self._authenticated:
                raise NotAuthenticatedException('Function {} requires'
                                                .format(func.__name__)
                                                + ' authentication')
            else:
                return func(self, *args, **kwargs)
        return _auth
801286
def with_context(self, required_by):
        
        if not required_by:
            return self
        args = self.args + (required_by,)
        return ContextualVersionConflict(*args)
851839
def required_perms(*req_perms):
    
    def dec_wrapper(wfunc):
        @wraps(wfunc)
        def wrapped(*args, **kwargs):
            user_id = kwargs.get("user_id")
            for perm in req_perms:
                check_perm(user_id, perm)

            return wfunc(*args, **kwargs)

        return wrapped
    return dec_wrapper
1020777
def requires(self, requirements, **overrides):
        """"""
        return self.where(requires=tuple(self.route.get('requires', ())) + tuple(requirements), **overrides)
664383
def require_pip_module(module):
    """"""

    def wrapper(func, *args, **kwargs):
        try:
            __import__(module)
        except ImportError:
            sys.stderr.write(
                "`pip install %s` to enable this feature\n" % module)
            sys.exit(1)
        else:
            return func(*args, **kwargs)
    return decorator(wrapper)
689418
function capability(cap, opt) {
	var self = {
		capabilitySetType : new type.UInt16Le(function() {
			return self.capability.obj.__TYPE__;
		}),
		lengthCapability : new type.UInt16Le(function() {
			return new type.Component(self).size();
		}),
		capability : cap || new type.Factory(function(s) {
			switch(self.capabilitySetType.value) {
			case CapsType.CAPSTYPE_GENERAL:
				self.capability = generalCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_BITMAP:
				self.capability = bitmapCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_ORDER:
				self.capability = orderCapability(null, {readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_BITMAPCACHE:
				self.capability = bitmapCacheCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_POINTER:
				self.capability = pointerCapability(false, {readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_INPUT:
				self.capability = inputCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_BRUSH:
				self.capability = brushCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_GLYPHCACHE:
				self.capability = glyphCapability(null, {readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_OFFSCREENCACHE:
				self.capability = offscreenBitmapCacheCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_VIRTUALCHANNEL:
				self.capability = virtualChannelCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_SOUND:
				self.capability = soundCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_CONTROL:
				self.capability = controlCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_ACTIVATION:
				self.capability = windowActivationCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_FONT:
				self.capability = fontCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_COLORCACHE:
				self.capability = colorCacheCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSTYPE_SHARE:
				self.capability = shareCapability({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			case CapsType.CAPSETTYPE_MULTIFRAGMENTUPDATE:
				self.capability = multiFragmentUpdate({readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
				break;
			default:
				log.debug('unknown capability ' + self.capabilitySetType.value);
				self.capability = new type.BinaryString(null, {readLength : new type.CallableValue(function() {
					return self.lengthCapability.value - 4;
				})}).read(s);
			}
		})
	};
	
	return new type.Component(self, opt);
}
283632
function amdefineWorkaround(requiredModule)
{
  // prepare define function
  var define = amdefine(requiredModule, this.pretendRequire(requiredModule));

  // return wrapper
  function wrapper(id, deps, initializer)
  {
    // init module
    define(id, deps, initializer);

    // if module provides id
    // force it to be executed anyway
    if (typeof id == 'string')
    {
      requiredModule.exports = define.require(id);
    }
  }

  // make it look like legit thing
  if (this.exposeAmdefine)
  {
    wrapper.amd     = define.amd;
    wrapper.require = define.require;
  }

  return wrapper;
}