def foo(ctx, x): global called # # test that access to the XPath evaluation contexts # pctxt = libxml2.xpathParserContext(_obj=ctx) ctxt = pctxt.context() called = ctxt.function() return x + 1