def filtercalls(call_stack, modul, clas, func, full):
    mod_ignore = ['shutil', 'scipy.optimize', 're', 'os', 'sys', 'json']
func_ignore = ['CustomFunctionName', 'pdbcall']
clas_ignore = ['pdb']
return modul not in mod_ignore and func not in func_ignore and clas not in clas_ignore
How to prevent pycallgraph from entering standard library functions?