'hook function'

def func(self):

    caller = self.caller
    pycode = self.args
    if ('edit' in self.switches):
        caller.db._py_measure_time = ('time' in self.switches)
        EvEditor(self.caller, loadfunc=_py_load, savefunc=_py_code, quitfunc=_py_quit, key='Python    exec:    :w        or    :!', persistent=True, codefunc=_py_code)
        return
    if (not pycode):
        string = 'Usage:    @py    <code>'
        self.msg(string)
        return
    _run_code_snippet(caller, self.args, measure_time=('time' in self.switches))
