code: def profile_cprofile(fn_callable, prof_file):
      prof = cProfile.Profile()
      ret = prof.runcall(fn_callable)
      prof.dump_stats(prof_file)
      prof_stats = StringIO()
      p = pstats.Stats(prof_file, stream=prof_stats)
      p.strip_dirs().sort_stats("cumulative").print_stats(0.5)
      return ret, prof_stats.getvalue()
  
imports: import cProfile
  import functools
  import os
  import pstats
  import timeit
  from contextlib import contextmanager
  from io import StringIO
  from prettytable import ALL, PrettyTable
label_desc: Use image node_id 3 for calling a global function with example usage: profile_cprofile(fn_callable, prof_file) and returns: ret,  prof_stats