To profile a function one can use:
import cProfile
print cProfile.run('foo()')
Is it possible to use vmprof in similar way, i.e. just to profile one function from within the code? I'm asking because the linked docs only shows how to run it from command line:
python -m vmprof <program.py> <program parameters>