def invoke(self, function_name, event, stdout=None, stderr=None):
<EOL>function = self.provider.get(function_name)<EOL>if not function:<EOL><INDENT>all_functions = [f.name for f in self.provider.get_all()]<EOL>available_function_message = "<STR_LIT>".format(function_name, all_functions)<EOL>LOG.info(available_function_message)<EOL>raise FunctionNotFound("<STR_LIT>", function_name)<EOL><DEDENT>LOG.debug("<STR_LIT>", function_name)<EOL>LOG.info("<STR_LIT>", function.handler, function.runtime)<EOL>config = self._get_invoke_config(function)<EOL>self.local_runtime.invoke(config, event, debug_context=self.debug_context, stdout=stdout, stderr=stderr)<EOL>
Find the Lambda function with given name and invoke it. Pass the given event to the function and return
response through the given streams.

This function will block until either the function completes or times out.

Parameters
----------
function_name str
    Name of the Lambda function to invoke
event str
    Event data passed to the function. Must be a valid JSON String.
stdout samcli.lib.utils.stream_writer.StreamWriter
    Stream writer to write the output of the Lambda function to.
stderr samcli.lib.utils.stream_writer.StreamWriter
    Stream writer to write the Lambda runtime logs to.

Raises
------
FunctionNotfound
    When we cannot find a function with the given name