Register a callable by key.

 The callable should be given in a block which will be lazily evaluated
 when the action is needed.

 If an action by the given name already exists then it will be
 overwritten.
974957
def register(key, value=nil, &block)
      block = lambda { value } if value
      @actions[key] = block
    end
187340
def register_app(self, name: str, app: Callable = None) -> Callable:
        
        if app is None:
            def dec(app):
                """ inner decorator for register app """
                assert app is not None
                self.register_app(name, app)
                return app
            return dec
        self.applications[name] = app
        return None
344917
def register(action)
      if(action.is_a?(Array))
        if(action.find{|x|x.is_a?(Action)}.nil?)
          raise ArgumentError.new('Array contains non ActionTimer::Action objects')
        end
      else
        raise ArgumentError.new('Expecting an ActionTimer::Action object') unless action.is_a?(Action)
        action = [action]
      end
      @add_lock.synchronize{ @new_actions = @new_actions + action }
      wakeup if running?
    end
188011
protected void registerStaticMethod(final String name, final Closure callable, final Class[] paramTypes) {
        performOperationOnMetaClass(new Callable() {
            public void call() {
                String methodName;
                if (name.equals(METHOD_MISSING))
                    methodName = STATIC_METHOD_MISSING;
                else if (name.equals(PROPERTY_MISSING))
                    methodName = STATIC_PROPERTY_MISSING;
                else
                    methodName = name;

                ClosureStaticMetaMethod metaMethod = null;

                if (paramTypes != null) {
                    metaMethod = new ClosureStaticMetaMethod(methodName, theClass, callable, paramTypes);
                } else {
                    metaMethod = new ClosureStaticMetaMethod(methodName, theClass, callable);
                }

                if (methodName.equals(INVOKE_METHOD_METHOD) && callable.getParameterTypes().length == 2) {
                    invokeStaticMethodMethod = metaMethod;
                } else {
                    if (methodName.equals(METHOD_MISSING)) {
                        methodName = STATIC_METHOD_MISSING;
                    }
                    MethodKey key = new DefaultCachedMethodKey(theClass, methodName, metaMethod.getParameterTypes(), false);

                    addMetaMethod(metaMethod);
                    dropStaticMethodCache(methodName);
//                    cacheStaticMethod(key,metaMethod);

                    if (isGetter(methodName, metaMethod.getParameterTypes())) {
                        String propertyName = getPropertyForGetter(methodName);
                        registerBeanPropertyForMethod(metaMethod, propertyName, true, true);

                    } else if (isSetter(methodName, metaMethod.getParameterTypes())) {
                        String propertyName = getPropertyForSetter(methodName);
                        registerBeanPropertyForMethod(metaMethod, propertyName, false, true);
                    }
                    performRegistryCallbacks();
                    expandoMethods.put(key, metaMethod);
                }
            }

        });
    }
901270
public function registerGetMutator($callable, bool $stack = false, string $property = null): self
    {
        return $this->registerMutator(self::OPERATOR_GET, $callable, $stack, $property);
    }
1142863
def register(self, name, asymmetric=False):
        
        def register_func(func):
            if asymmetric:
                self._asymmetric.append(name)
            self.store[name] = func
            return func
        return register_func
682073
def register(self, func):
        
        if callable(func):
            self.functions[func.__name__] = func
        return func
1135319
def register(self, name):
        
        def register_func(func):
            self.store[name] = func
            return func
        return register_func
754028
def register(key, initializer: callable, param=None):
    ''''''
    get_current_scope().container.register(key, initializer, param)
1021570
def register(callback, schedule, tag=None):
    

    try:
        iter(schedule)
    except TypeError:
        raise TypeError("{} is not iterable".format(schedule))

    if not callable(callback):
        raise TypeError("{} is not callable".format(callback))

    thread = Timer(schedule, callback, tag)

    id_ = str(uuid.uuid4())
    with LOCK:
        REGISTRY[id_] = thread

    thread.start()

    return id_
1232615
public function register_block($name, $callback, $cacheable = true, $cache_attrs = null)
    {
        if (isset($this->plugins[$name]) && $this->plugins[$name][0] !== self::SMARTY_BLOCK) {
            throw new Exception('Multiple plugins of different types can not share the same name');
        }
        $this->plugins[$name] = array(
            'type'     => self::SMARTY_BLOCK,
            'callback' => $callback
        );
    }
1072607
def register_action(self, action):
        
        assert action.value not in self.actions
        self.actions[action.value] = action
80130
def register(name):
    
    assert isinstance(name, six.text_type)
    def decorator(handler):
        assert callable(handler)

        _readline_commands[name] = handler
        return handler
    return decorator
369636
def use(self, func, when='whenever'):
        '''  '''
        #NOTE A middleware Object ?
        # self.use() is usually called from initialize(), so no logger yet
        print('registering middleware {}'.format(func.__name__))
        self.middlewares.append({
            'call': func,
            'name': func.__name__,
            'args': func.func_code.co_varnames,
            'when': when
        })
396532
public void registerCallback(UOWCallback callback)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerCallback", callback);

        if (!_callbacks.contains(callback))
        {
            _callbacks.add(callback);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Number of registered Callbacks: "+_callbacks.size());
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "registerCallback");
    }
806634
def register(self, key, value):
        

        self._actions[key] = value

        # invalidate cache of results for existing key
        if key in self._cache:
            del self._cache[key]
1083835
private void requirePkInitialized(CodeBuilder b, String methodName) {
        // Add code to call method which we are about to define.
        b.loadThis();
        b.invokeVirtual(methodName, null, null);

        // Now define new method, discarding original builder object.
        b = new CodeBuilder(mClassFile.addMethod(Modifiers.PROTECTED, methodName, null, null));
        b.loadThis();
        b.invokeVirtual(IS_REQUIRED_PK_INITIALIZED_METHOD_NAME, TypeDesc.BOOLEAN, null);
        Label pkInitialized = b.createLabel();
        b.ifZeroComparisonBranch(pkInitialized, "!=");
        CodeBuilderUtil.throwException
            (b, IllegalStateException.class, "Primary key not fully specified");
        pkInitialized.setLocation();
        b.returnVoid();
    }