To make it user independant you have to put everything into a function, which when you do that, you can't reference stuff like in most of their examples.
Can't you like wrap stuff into classes or something? or like use `functools.partial` to pass the objects to those functions that you say have no access to stuff, just pass that stuff to that function