Execute a function, atomically and reply with the result.
186796
def run_fn_atomically(self, request):
        """"""
        fn = serializer.loads_fn(request[Msgs.info])
        args, kwargs = request[Msgs.args], request[Msgs.kwargs]
        with self.mutate_safely():
            self.reply(fn(self.state, *args, **kwargs))
591857
def process_response(self, request, response):
        """"""
        batcher = PrioritizedBatcher.global_instance()
        if batcher.is_started:
            # May not be started due to strange middleware behavior on first request.
            batcher.commit()

        return response
28723
function execute(req, res) {
  req.conn.monitor(this);
  res.send(null, Constants.OK);
}
308736
def _execute_callback(self, callback, data):
        """"""
        web_client = WebClient(
            token=self.token, base_url=self.base_url, ssl=self.ssl, proxy=self.proxy
        )
        with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
            # Execute the callback on a separate thread,
            future = executor.submit(
                callback, rtm_client=self, web_client=web_client, data=data
            )

            while future.running():
                pass

            future.result()
1319921
async def execute(self, stmt, *args):
        
        with (await self.application.db.cursor()) as cur:
            await cur.execute(stmt, args)
1222386
def _execute_if_not_empty(func):
    
    def wrapper(*args, **kwargs):
        if any(args[1:]) or any(kwargs.items()):
            return func(*args, **kwargs)
    return wrapper
360172
def execute(self, return_results=True):
        '''
        
        '''
        if self.results:
            return self.results if return_results else None

        self.execute_raw()

        if self._raw_results_only:
            self.results = self.raw_results
        else:
            self.map_results()

        if return_results:
            return self.results
1052018
def async_make_reply(msgname, types, arguments_future, major):
    """"""
    arguments = yield arguments_future
    raise gen.Return(make_reply(msgname, types, arguments, major))
716001
def execute(self, *args):
        """"""
        command, kwargs = self.parse(*args)
        return self._commands.execute(command, **kwargs)
1052614
async def execute_command(
        self, *args: bytes, timeout: NumType = None
    ) -> SMTPResponse:
        
        command = b" ".join(args) + b"\r\n"

        await self.write_and_drain(command, timeout=timeout)
        response = await self.read_response(timeout=timeout)

        return response
8693
def execute(cmd):
    """"""
    proc = Popen(cmd, stdout=PIPE)
    stdout, _ = proc.communicate()
    if proc.returncode != 0:
        raise CalledProcessError(proc.returncode, " ".join(cmd))

    return stdout.decode('utf8')
675350
def execute(self, js_str, timeout=0, max_memory=0):
        

        wrapped = "(function(){return (%s)})()" % js_str
        return self.eval(wrapped, timeout, max_memory)
961963
function execute(req, res) {
  if(req.args.length) return res.send(null, req.args[0]);
  res.send(null, Constants.PONG);
}
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)
780532
def execute(self, fn, *args, **kwargs):
        """"""
        if self.in_executor_context():
            corofn = asyncio.coroutine(lambda: fn(*args, **kwargs))
            return corofn()
        future = self.submit(fn, *args, **kwargs)
        return future.result()
754476
def execute_process_async(func, *args, **kwargs):
  
  global _GIPC_EXECUTOR
  if _GIPC_EXECUTOR is None:
    _GIPC_EXECUTOR = GIPCExecutor(
      num_procs=settings.node.gipc_pool_size,
      num_greenlets=settings.node.greenlet_pool_size)
  return _GIPC_EXECUTOR.submit(func, *args, **kwargs)
236541
def submit(self, fn, *args, **kwargs):
        """"""
        corofn = asyncio.coroutine(lambda: fn(*args, **kwargs))
        return run_coroutine_threadsafe(corofn(), self.loop)