def get_caller_module_dict(levels):
    try:
        raise RuntimeError
    except __HOLE__:
        e,b,t = sys.exc_info()
        f = t.tb_frame
        while levels > 0:
            f = f.f_back                   
            levels -= 1
        ldict = f.f_globals.copy()
        if f.f_globals != f.f_locals:
            ldict.update(f.f_locals)

        return ldict

# -----------------------------------------------------------------------------
# _funcs_to_names()
#
# Given a list of regular expression functions, this converts it to a list
# suitable for output to a table file
# -----------------------------------------------------------------------------
dataset/ETHPy150Open 0x-omicron/py-dcpu-c-compiler/external/ply/lex.py/get_caller_module_dict