def METHOD_NAME(
    context,
    function_identifier,
    closure_variables,
    user_variables,
    outline_variables,
    temp_variables,
    needs_exception_exit,
    needs_generator_return,
):
    # A bit of details going on here, pylint: disable=too-many-locals
    setupFunctionLocalVariables(
        context=context,
        parameters=None,
        closure_variables=closure_variables,
        user_variables=user_variables + outline_variables,
        temp_variables=temp_variables,
    )
    function_codes = SourceCodeCollector()
    generateStatementSequenceCode(
        statement_sequence=context.getOwner().subnode_body,
        allow_none=True,
        emit=function_codes,
        context=context,
    )
    function_cleanup = finalizeFunctionLocalVariables(context)
    if needs_exception_exit:
        (
            exception_type,
            exception_value,
            exception_tb,
            _exception_lineno,
        ) = context.variable_storage.getExceptionVariableDescriptions()
        generator_exit = template_generator_exception_exit % {
            "function_cleanup": indented(function_cleanup),
            "exception_type": exception_type,
            "exception_value": exception_value,
            "exception_tb": exception_tb,
        }
    else:
        generator_exit = template_generator_noexception_exit % {
            "function_cleanup": indented(function_cleanup)
        }
    if needs_generator_return:
        generator_exit += template_generator_return_exit % {
            "return_value": context.getReturnValueName()
            if python_version >= 0x300
            else None
        }
    function_locals = context.variable_storage.makeCFunctionLevelDeclarations()
    local_type_decl = context.variable_storage.makeCStructLevelDeclarations()
    function_locals += context.variable_storage.makeCStructInits()
    generator_object_body = context.getOwner()
    if local_type_decl:
        heap_declaration = """\