Runs through all the callable functions provided, if all are met call the given callable
@author Tim Perry
9944
public function run()
    {
        if (!isset($this->conditions)
            || !isset($this->callable)
        ) {

            $message = "You have called the run function but have not provided both a array of conditions";
            $message .= " and a callable function, which will be called if all the given conditions are met.";

            throw new \RuntimeException($message);
        }

        $this->conditions->rewind();
        while ($this->conditions->valid()) {

            $condition = $this->conditions->current();

            if (!call_user_func($condition)) {
                return false;
            }

            $this->conditions->next();
        }

        call_user_func($this->callable, $this->request);
        return true;

    }
1080948
def apply_if_callable(maybe_callable, obj, **kwargs):
    

    if callable(maybe_callable):
        return maybe_callable(obj, **kwargs)

    return maybe_callable
1198396
def _run_done_callbacks(self):
        ''' 
        '''
        with self._callbacks_lock:
            for callback in self._done_callbacks:
                try:
                    callback()
                # We do not want a callback interrupting the process, especially
                # in the failure cleanups. So log and catch, the excpetion.
                except Exception as ex:
                    logger.error("Exception: %s" % str(ex))
                    logger.error("Exception raised in %s." % callback, exc_info=True)

            self._done_callbacks = []
776454
public static <V> Try<V> tryCall(Callable<V> callable) {
        try {
            return Try.succeeded(callable.call());
        } catch (Exception e) {
            return Try.failed(e);
        }
    }
1179627
def _fcall_out_type(fcall):
    
    if isinstance(fcall, FunctionSpaceElement):
        call_has_out = fcall._call_has_out
        call_out_optional = fcall._call_out_optional

    # Numpy Ufuncs and similar objects (e.g. Numba DUfuncs)
    elif hasattr(fcall, 'nin') and hasattr(fcall, 'nout'):
        if fcall.nin != 1:
            raise ValueError('ufunc {} has {} input parameter(s), '
                             'expected 1'
                             ''.format(fcall.__name__, fcall.nin))
        if fcall.nout > 1:
            raise ValueError('ufunc {} has {} output parameter(s), '
                             'expected at most 1'
                             ''.format(fcall.__name__, fcall.nout))
        call_has_out = call_out_optional = (fcall.nout == 1)
    elif inspect.isfunction(fcall):
        call_has_out, call_out_optional = _check_out_arg(fcall)
    elif callable(fcall):
        call_has_out, call_out_optional = _check_out_arg(fcall.__call__)
    else:
        raise TypeError('object {!r} not callable'.format(fcall))

    return call_has_out, call_out_optional
88703
public function all(callable $iterator) : bool
    {
        foreach ($this as $k => $v) {
            if (!call_user_func($iterator, $v, $k, $this)) {
                return false;
            }
        }
        return true;
    }
271173
function recursiveCall(i, callback) {
            if(i >= _modules.length) {
                callback();
            } else {
                _modules[i].check(req, res, function () {
                    recursiveCall(++i, callback);
                })
            }
        }
324963
def run_func(func, *args, **kwargs):
    """"""
    ray.init()

    func = ray.remote(func)

    # NOTE: kwargs not allowed for now
    result = ray.get(func.remote(*args))

    # Inspect the stack to get calling example
    caller = inspect.stack()[1][3]
    print("%s: %s" % (caller, str(result)))

    return result
601504
def _event_funcs(self, event: str) -> Iterable[Callable]:
        
        for func in self._events[event]:
            yield func
976141
def is_callable(*p):
    
    import symbols
    return all(isinstance(x, symbols.FUNCTION) for x in p)
473234
def all(pred: Callable, xs: Iterable):
    
    for x in xs:
        if not pred(x):
            return False

    return True
127074
public static function invokeCallable($callable, $args = null)
    {
        if (null != $args) {
            if (is_array($args)) {
                $results = call_user_func_array($callable, $args);
            } else {
                $results = call_user_func($callable, $args);
            }
        } else {
            $results = call_user_func($callable);
        }

        return $results;
    }
133289
def run(self, func, *func_args, **func__kwargs):
        
        self._func = func
        self._func_args = func_args
        self._func_kwargs = func__kwargs
        return self
1173230
@Override
  public void run() {
    synchronized (lock) {
      if (!callables.hasNext()) {
        checkEnd();
        return;
      }

      for (int i = 0; i < parallelism && callables.hasNext(); i++) {
        setupNext(callables.next());
      }
    }

    future.whenCancelled(() -> {
      cancel = true;
      checkNext();
    });
  }
595370
function() {
			try {
				if (fn) {
					/**
					 * Insert a done() or ok() argument to other needed arguments
					 */
					syntheticArgs.unshift(function() {
						/**
						 * Call the next in queue
						 */
						$this.next.apply($this, arguments);
					});
					/**
					 * Call the function finally
					 */
					fn.apply(this, syntheticArgs);
				} else {
					syntheticArgs = syntheticArgs || [];
					/**
					 * If no function passed, call the next in queue
					 */
					$this.next.apply(this, syntheticArgs);
				}
			} catch(e) {
				/**
				 * An error caught is thrown directly to the catch handler, if any
				 */
				if (this.onCatch) {
					this.onCatch(e);
				} else {
					throw e;
				}
			}
		}
969737
public function execute($callable, array $args = [], $context = null)
    {
        if ($callable instanceof \Closure) {
            $ref = new \ReflectionObject($callable);

            $args = $this->getMethodArgs($ref->getMethod('__invoke'), $args);
        } else {
            if (is_string($callable)) {
                $callable = explode('::', $callable);
            }

            list($object, $method) = $callable;

            $ref = new \ReflectionClass($object);

            $args = $this->getMethodArgs($ref->getMethod($method), $args);
        }

        $closure = function () use ($args, $callable) {
            switch (count($args)) {
                case 0:
                    return $callable();
                case 1:
                    return $callable($args[0]);
                case 2:
                    return $callable($args[0], $args[1]);
                case 3:
                    return $callable($args[0], $args[1], $args[2]);
                case 4:
                    return $callable($args[0], $args[1], $args[2], $args[3]);
                default:
                    return call_user_func_array($callable, $args);
            }
        };

        if ($context) {
            $closure = $closure->bindTo($context, $context);
        }

        return $closure();
    }
1247072
public function each($callable)
    {
        if ($this instanceof Iterator) {

            if (is_string($callable)) {
                foreach ($this as $obj) {
                    if ($obj->$callable() === false) {
                        break;
                    }
                }

                return $this;
            }

            foreach ($this as $obj) {
                if (call_user_func($callable, $obj) === false) {
                    break;
                }
            }

        } else {
            throw $this->exception('Calling each() on non-iterative object');
        }

        return $this;
    }