Return a callSignal function.
961907
function makeCallSignal (signals, opts) {
  return (address, signalName, arg) => {
    if (opts.verbose) {
      console.log('Called signal ' + signalName + ' at [' + address.join(', ') +
                  '].')
    }
    signals.get(address).data.signals[signalName].call(arg)
  }
}
682073
def register(self, func):
        
        if callable(func):
            self.functions[func.__name__] = func
        return func
1363178
def handler(event):
    """"""
    def decorator(fn):
        def apply(cls):
            event.connect(fn, sender=cls)
            return cls

        fn.apply = apply
        return fn
    return decorator
1211228
def call(self):
        """"""
        assert self.satisfied, self
        LOG.debug('call %s.%s', self.func.__module__, self.func.__qualname__)
        kwargs = {arg.name: arg.read() for arg in self.args}
        out_value = self.func(**kwargs)
        if self.writeto is None:
            writeto = set()
        elif isinstance(self.writeto, Variable):
            self.writeto.write(out_value)
            writeto = {self.writeto}
        else:
            # A variable can be written multiple times, but we only
            # return a unique set of variables.
            for var, value in zip(self.writeto, out_value):
                var.write(value)
            writeto = set(self.writeto)
        self._release()  # Only call _release() on normal exit.
        return writeto
124479
def call_func(self, fun, **kwargs):
        '''
        
        '''
        return self.low(fun, kwargs, print_event=kwargs.get('print_event', True), full_return=kwargs.get('full_return', False))
454176
def call(__self, __context, __obj, *args, **kwargs):
        """"""
        fmt = inspect_format_method(__obj)
        if fmt is not None:
            return __self.format_string(fmt, args, kwargs)

        # the double prefixes are to avoid double keyword argument
        # errors when proxying the call.
        if not __self.is_safe_callable(__obj):
            raise SecurityError('%r is not safely callable' % (__obj,))
        return __context.call(__obj, *args, **kwargs)
1085399
def _call_function(self, kwargs):
        '''
        
        '''
        if self._raise_later:
            raise self._raise_later  # pylint: disable=E0702

        if self._function:
            args, kwargs = self._get_args(kwargs)
            try:
                return self._function(*args, **kwargs)
            except TypeError as error:
                error = six.text_type(error).replace(self._function, self._orig_f_name)  # Hide hidden functions
                log.error(
                    'Function "%s" was not properly called: %s',
                    self._orig_f_name, error
                )
                return self._function.__doc__
            except Exception as error:
                log.error(
                    'Unhandled exception occurred in function "%s: %s',
                    self._function.__name__, error
                )
                raise error
        else:
            raise CommandExecutionError("Function is deprecated, but the successor function was not found.")
576124
def visit_FunctionCall(self, node):
        """"""
        function_name = node.identifier.name
        call = self.table[function_name]
        if call is None:
            raise SementicError(f"Function `{function_name}` not declared.")
        else:
            call = call._node

        if isinstance(call, AST):
            if len(call.parameters) != len(node.parameters):
                raise SementicError(
                    "Mismatch between call and function parameters number."
                )

            current_table = self.table.stack.current
            functions_in_table = {
                key: current_table[key]
                for key in current_table
                if isinstance(current_table[key], FunctionSymbol)
            }

            if self.table.name == function_name:
                # End the visit in case of recursion
                return

            self.table.append_table(function_name, **functions_in_table)
            self.visit(call)
            self.table.pop_table()
1231757
def call(function):
    
    message = 'call:%s.%s' % (function.__module__,function.__name__)
    @functools.wraps(function)
    def wrapper(*args, **kwargs):
        _collect(message)
        return function(*args, **kwargs)

    return wrapper
106777
def decorator(caller, _func=None):
    """"""
    if _func is not None:  # return a decorated function
        # this is obsolete behavior; you should use decorate instead
        return decorate(_func, caller)
    # else return a decorator function
    if inspect.isclass(caller):
        name = caller.__name__.lower()
        doc = 'decorator(%s) converts functions/generators into ' \
              'factories of %s objects' % (caller.__name__, caller.__name__)
    elif inspect.isfunction(caller):
        if caller.__name__ == '<lambda>':
            name = '_lambda_'
        else:
            name = caller.__name__
        doc = caller.__doc__
    else:  # assume caller is an object with a __call__ method
        name = caller.__class__.__name__.lower()
        doc = caller.__call__.__doc__
    evaldict = dict(_call_=caller, _decorate_=decorate)
    return FunctionMaker.create(
        '%s(func)' % name, 'return _decorate_(func, _call_)',
        evaldict, doc=doc, module=caller.__module__,
        __wrapped__=caller)
1305862
def run_func(entry):
    """"""
    if entry.func:
        if entry.args and entry.krgs:
            return entry.func(*entry.args, **entry.krgs)
        if entry.args:
            return entry.func(*entry.args)
        if entry.krgs:
            return entry.func(**entry.krgs)
        return entry.func()
973056
def func_call(self, t):
        
        func, params = t
        func_name = func.value
        func.value = "({}({}))".format(func_name, params)
        return func
478536
def CallFunction(self):
    """"""
    if self._xmlrpc_proxy is None:
      return None

    rpc_call = getattr(self._xmlrpc_proxy, self._RPC_FUNCTION_NAME, None)
    if rpc_call is None:
      return None

    try:
      return rpc_call()  # pylint: disable=not-callable
    except (
        expat.ExpatError, SocketServer.socket.error,
        xmlrpclib.Fault) as exception:
      logger.warning('Unable to make RPC call with error: {0!s}'.format(
          exception))
      return None
156783
def signalcommand(func):
    """"""

    def inner(self, *args, **kwargs):
        pre_command.send(self.__class__, args=args, kwargs=kwargs)
        ret = func(self, *args, **kwargs)
        post_command.send(self.__class__, args=args, kwargs=kwargs, outcome=ret)
        return ret
    return inner
488109
def callback(name, params, returns)
      params, returns = generate_signature(params, returns)
      super name.to_sym, params, returns
    end
535373
def call_func(self, *args, **kwargs):
        """"""
        asyncio.gather(
            self.cron(*args, **kwargs),
            loop=self.loop, return_exceptions=True
            ).add_done_callback(self.set_result)
67257
def _get_activation(self, F, inputs, activation, **kwargs):
        """"""
        func = {'tanh': F.tanh,
                'relu': F.relu,
                'sigmoid': F.sigmoid,
                'softsign': F.softsign}.get(activation)
        if func:
            return func(inputs, **kwargs)
        elif isinstance(activation, string_types):
            return F.Activation(inputs, act_type=activation, **kwargs)
        elif isinstance(activation, LeakyReLU):
            return F.LeakyReLU(inputs, act_type='leaky', slope=activation._alpha, **kwargs)
        return activation(inputs, **kwargs)