def mock(func):
@wraps(func)<EOL>def mock_invoke_internal(self, function_arn, payload, client_context, invocation_type="<STR_LIT>"):<EOL><INDENT>if MY_FUNCTION_ARN is None:<EOL><INDENT>if invocation_type == '<STR_LIT>':<EOL><INDENT>return {<EOL>'<STR_LIT>': json.dumps({<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}),<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL><DEDENT>elif invocation_type == '<STR_LIT>':<EOL><INDENT>return {<EOL>'<STR_LIT>': b'<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>'.format(invocation_type))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return func(self, function_arn, payload, client_context, invocation_type)<EOL><DEDENT><DEDENT>return mock_invoke_internal<EOL>
mock decorates _invoke_internal by checking if MY_FUNCTION_ARN is present
if MY_FUNCTION_ARN is present, the actual _invoke_internal is invoked
otherwise, the mock _invoke_internal is invoked