def enable_thread_profiling(profile_dir, exception_callback=None):
    global profiled_thread_enabled, Thread, Process
    if os.path.isdir(profile_dir):
        _Profiler.profile_dir = profile_dir
    else:
        raise OSError('%s does not exist' % profile_dir)
    _Profiler.exception_callback = exception_callback
    Thread = threading.Thread = ProfiledThread
    Process = multiprocessing.Process = ProfiledProcess
    profiled_thread_enabled = True
This applies ordering to the result set
dataset/ETHPy150Open lobocv/pyperform/pyperform/thread.py/enable_thread_profiling--crossover with--dataset/ETHPy150Open torchbox/wagtail/wagtail/contrib/wagtailapi/filters.py/OrderingFilter.filter_queryset