# Path: stackimpact/runtime.py
# def min_version(major, minor=0):
#     return (sys.version_info.major == major and sys.version_info.minor >= minor)
# 
# class runtime_info(object):
#     OS_LINUX = (sys.platform.startswith('linux'))
#     OS_DARWIN = (sys.platform == 'darwin')
#     OS_WIN = (sys.platform == 'win32')
#     PYTHON_2 = (sys.version_info.major == 2)
#     PYTHON_3 = (sys.version_info.major == 3)
#     GEVENT = False


import time
import unittest
import random
import threading
import stackimpact
from stackimpact.runtime import min_version, runtime_info
            mem_leak2()

        def mem_leak4():
            mem_leak3()

        def mem_leak5():
            mem_leak4()

        result = {}
        def record():
            agent.allocation_reporter.profiler.start_profiler()
            time.sleep(2)
            agent.allocation_reporter.profiler.stop_profiler()

        t = threading.Thread(target=record)
        t.start()

        # simulate leak
        mem_leak5()

        t.join()

        profile = agent.allocation_reporter.profiler.build_profile(2)[0]['profile'].to_dict()
        #print(str(profile))

        self.assertTrue('allocation_profiler_test.py' in str(profile))

        agent.destroy()



# Path: stackimpact/runtime.py
# def min_version(major, minor=0):
#     return (sys.version_info.major == major and sys.version_info.minor >= minor)
# 
# class runtime_info(object):
#     OS_LINUX = (sys.platform.startswith('linux'))
#     OS_DARWIN = (sys.platform == 'darwin')
#     OS_WIN = (sys.platform == 'win32')
#     PYTHON_2 = (sys.version_info.major == 2)
#     PYTHON_3 = (sys.version_info.major == 3)
#     GEVENT = False


# Path: tests/profilers/allocation_profiler_test.py
import time
import unittest
import random
import threading
import stackimpact
from stackimpact.runtime import min_version, runtime_info

            mem_leak2()

        def mem_leak4():
            mem_leak3()

        def mem_leak5():
            mem_leak4()

        result = {}
        def record():
            agent.allocation_reporter.profiler.start_profiler()
            time.sleep(2)
            agent.allocation_reporter.profiler.stop_profiler()

        t = threading.Thread(target=record)
        t.start()

        # simulate leak
        mem_leak5()

        t.join()

        profile = agent.allocation_reporter.profiler.build_profile(2)[0]['profile'].to_dict()
        #print(str(profile))

        self.assertTrue('allocation_profiler_test.py' in str(profile))

        agent.destroy()



if __name__ == '__main__':