'Creates a profiler for a function.
Every profiler has its own log file (the name of which is derived
from the function name).
FuncProfile registers an atexit handler that prints profiling
information to sys.stderr when the program terminates.'

def __init__(self, fn, skip=0, filename=None, immediate=False, dirs=False, sort=None, entries=40):

    self.fn = fn
    self.skip = skip
    self.filename = filename
    self.immediate = immediate
    self.dirs = dirs
    self.sort = (sort or ('cumulative', 'time', 'calls'))
    if isinstance(self.sort, str):
        self.sort = (self.sort,)
    self.entries = entries
    self.reset_stats()
    atexit.register(self.atexit)
