def invoke(self,<EOL>function_config,<EOL>event,<EOL>debug_context=None,<EOL>stdout=None,<EOL>stderr=None):
timer = None<EOL>environ = function_config.env_vars<EOL>environ.add_lambda_event_body(event)<EOL>env_vars = environ.resolve()<EOL>with self._get_code_dir(function_config.code_abs_path) as code_dir:<EOL><INDENT>container = LambdaContainer(function_config.runtime,<EOL>function_config.handler,<EOL>code_dir,<EOL>function_config.layers,<EOL>self._image_builder,<EOL>memory_mb=function_config.memory,<EOL>env_vars=env_vars,<EOL>debug_options=debug_context)<EOL>try:<EOL><INDENT>self._container_manager.run(container)<EOL>timer = self._configure_interrupt(function_config.name,<EOL>function_config.timeout,<EOL>container,<EOL>bool(debug_context))<EOL>container.wait_for_logs(stdout=stdout, stderr=stderr)<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL><DEDENT>finally:<EOL><INDENT>if timer:<EOL><INDENT>timer.cancel()<EOL><DEDENT>self._container_manager.stop(container)<EOL><DEDENT><DEDENT>
Invoke the given Lambda function locally.

##### NOTE: THIS IS A LONG BLOCKING CALL #####
This method will block until either the Lambda function completes or timed out, which could be seconds.
A blocking call will block the thread preventing any other operations from happening. If you are using this
method in a web-server or in contexts where your application needs to be responsive when function is running,
take care to invoke the function in a separate thread. Co-Routines or micro-threads might not perform well
because the underlying implementation essentially blocks on a socket, which is synchronous.

:param FunctionConfig function_config: Configuration of the function to invoke
:param event: String input event passed to Lambda function
:param DebugContext debug_context: Debugging context for the function (includes port, args, and path)
:param io.IOBase stdout: Optional. IO Stream to that receives stdout text from container.
:param io.IOBase stderr: Optional. IO Stream that receives stderr text from container
:raises Keyboard