Registers a callback to be invoked when the RDFValue named is declared.
2146
def RegisterLateBindingCallback(target_name, callback, **kwargs):
  """"""
  _LATE_BINDING_STORE.setdefault(target_name, []).append((callback, kwargs))
876320
function listen(name, callback) {
    if (!showdown.helper.isString(name)) {
      throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
    }

    if (typeof callback !== 'function') {
      throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
    }

    if (!listeners.hasOwnProperty(name)) {
      listeners[name] = [];
    }
    listeners[name].push(callback);
  }
132577
@Override
    public void registerEarlyRead(InterChannelCallback cb) {
        // LI4335.2
        if (null == cb) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "registerEarlyRead: Invalid null callback as input.");
            }
            throw new IllegalArgumentException("Callback is null");
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "App channel requesting early response read on " + getVC());
        }
        this.bEarlyReads = true;
        startEarlyRead(cb, true);
    }
404328
def register_hook(self, event, hook):
        """"""

        if event not in self.hooks:
            raise ValueError('Unsupported event specified, with event name "%s"' % (event))

        if isinstance(hook, Callable):
            self.hooks[event].append(hook)
        elif hasattr(hook, '__iter__'):
            self.hooks[event].extend(h for h in hook if isinstance(h, Callable))
162262
def register_callback_renamed(self, func, serialised=True):
        
        self.__add_callback(_CB_RENAMED, func, serialised_if_crud=serialised)
355982
public void registerDestructionCallback(String name, Runnable callback) {
		Bean bean = beans.get(name);
		if (null == bean) {
			bean = new Bean();
			beans.put(name, bean);
		}
		bean.destructionCallback = callback;
	}
689316
def _register_handler(event, fun, external=False):
    """"""
    registry = core.HANDLER_REGISTRY
    if external:
        registry = core.EXTERNAL_HANDLER_REGISTRY

    if not isinstance(event, basestring):
        # If not basestring, it is a BaseEvent subclass.
        # This occurs when class methods are registered as handlers
        event = core.parse_event_to_name(event)

    if event in registry:
        registry[event].append(fun)
    else:
        registry[event] = [fun]
    return fun
1128579
def event(self, interface_id, key, value):
        
        LOG.info(
            "HMGeneric.event: address=%s, interface_id=%s, key=%s, value=%s"
            % (self._ADDRESS, interface_id, key, value))

        self._VALUES[key] = value   # Cache the value

        for callback in self._eventcallbacks:
            LOG.debug("HMGeneric.event: Using callback %s " % str(callback))
            callback(self._ADDRESS, interface_id, key, value)
1025727
def add_callback(self, name, func):
        

        if name not in self.callbacks:
            raise ValueError("Unknown callback name: %s" % name)

        self.callbacks[name].add(func)
158486
private void updateBind(Node n) {
    CodingConvention.Bind bind =
        compiler.getCodingConvention().describeFunctionBind(n, false, true);
    if (bind == null) {
      return;
    }

    Node target = bind.target;
    FunctionType callTargetFn = getJSType(target)
        .restrictByNotNullOrUndefined().toMaybeFunctionType();
    if (callTargetFn == null) {
      return;
    }

    if (bind.thisValue != null && target.isFunction()) {
      JSType thisType = getJSType(bind.thisValue);
      if (thisType.toObjectType() != null && !thisType.isUnknownType()
          && callTargetFn.getTypeOfThis().isUnknownType()) {
        callTargetFn =
            FunctionType.builder(registry)
                .copyFromOtherFunction(callTargetFn)
                .withTypeOfThis(thisType.toObjectType())
                .build();
        target.setJSType(callTargetFn);
      }
    }

    n.setJSType(
        callTargetFn.getBindReturnType(
            // getBindReturnType expects the 'this' argument to be included.
            bind.getBoundParameterCount() + 1));
  }
315329
def register(value, name):
        
        if value in TokenKind._value_map:
            raise ValueError('TokenKind already registered: %d' % value)

        kind = TokenKind(value, name)
        TokenKind._value_map[value] = kind
        setattr(TokenKind, name, kind)
1044611
def make_call_with_cb(self, fun, *args):
        """"""

        cid, event = self.handler.register_callback()
        argscp = list(args)
        argscp.append(cid)
        self.make_call(fun, *argscp)
        return event
256050
public <V> SpyWithValue<V> call(Callable<V> callable) throws SniffyAssertionError {
        checkOpened();
        V result;

        try {
            result = callable.call();
        } catch (Throwable e) {
            throw verifyAndAddToException(e);
        }

        verify();
        return new SpyWithValue<V>(result);
    }
884897
@Override
  public void fireValueNodeChanged(IValueNode valueNode) {
    for (IDatabaseListener iDatabaseListener : listeners) {
      iDatabaseListener.valueNodeChanged(valueNode);
    }
  }
1085492
def InitializeContext(self, args):
    """"""
    if args is None:
      args = rdf_hunts.HuntRunnerArgs()

    context = rdf_hunts.HuntContext(
        create_time=rdfvalue.RDFDatetime.Now(),
        creator=self.token.username,
        duration=args.expiry_time,
        start_time=rdfvalue.RDFDatetime.Now(),
        usage_stats=rdf_stats.ClientResourcesStats())

    return context
781052
def register(self, event_type: str,
                 **data_detail: Any) -> Callable[[AsyncCallback], AsyncCallback]:
        """"""
        def decorator(func: AsyncCallback) -> AsyncCallback:
            self.add(func, event_type, **data_detail)
            return func
        return decorator
208667
public void registerEventCallback(ObjectManagerEventCallback callback)
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, "registerEventCallback", callback);

        objectManagerState.registerEventCallback(callback);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, "registerEventCallback");
    }