def METHOD_NAME(self, func):
    def call(pyfunc, return_type):
        # return _py2h(PyNumber_Add(_h2py(x), _h2py(y)))
        args = []
        for p in func.node.type.args.params:
            if toC(p.type) == 'HPyContext *':
                continue
            elif toC(p.type) == 'HPy':
                arg = '_h2py(%s)' % p.name
            elif toC(p.type) == 'HPyThreadState':
                arg = '_h2threads(%s)' % p.name
            else:
                arg = p.name
            args.append(arg)
        result = '%s(%s)' % (pyfunc, ', '.join(args))
        if return_type == 'HPy':
            result = '_py2h(%s)' % result
        elif return_type == 'HPyThreadState':
            result = '_threads2h(%s)' % result
        return result
    #
    lines = []
    w = lines.append
    pyfunc = func.cpython_name
    if not pyfunc:
        raise ValueError(f"Cannot generate implementation for {self}")
    const_return = get_return_constant(func)
    return_type = get_context_return_type(func.node, const_return)
    return_stmt = '' if return_type == 'void' else 'return '
    w(self.signature(func, const_return))
    w('{')
    w('    %s%s;' % (return_stmt, call(pyfunc, return_type)))
    if self.GENERATE_CONST_RETURN and const_return:
        w('    return %s;' % const_return)
    w('}')
    return '\n'.join(lines)