human
I wrote the below code

    '\n                cfg    =    compute_cfg_from_blocks(func_ir.blocks)\n                all_loops    =    list(cfg.loops().values())\n                def    find_nest_level(label):\n                                level    =    0\n                                for    loop    in    all_loops:\n                                                if    label    in    loop.body:\n                                                                level    +=    1\n                '
    def find_array_def(arr):
        'Find    numpy    array    definition    such    as\n                                                arr    =    numba.unsafe.ndarray.empty_inferred(...).\n                                If    it    is    arr    =    b[...],    find    array    definition    of    b    recursively.\n                                '
        arr_def = func_ir.get_definition(arr)
        _make_debug_print('find_array_def')(arr, arr_def)
        if isinstance(arr_def, ir.Expr):
            if guard(_find_unsafe_empty_inferred, func_ir, arr_def):
                return arr_def
            elif (arr_def.op == 'getitem'):
                return find_array_def(arr_def.value)
        raise GuardException
    def fix_array_assign(stmt):
        'For    assignment    like    lhs[idx]    =    rhs,    where    both    a    and    b    are    arrays,    do    the\n                                following:\n                                1.    find    the    definition    of    rhs,    which    has    to    be    a    call    to    numba.unsafe.ndarray.empty_inferred\n                                2.    find    the    source    array    creation    for    lhs,    insert    an    extra    dimension    of    size    of    b.\n                                3.    replace    the    definition    of    rhs    =    numba.unsafe.ndarray.empty_inferred(...)    with    rhs    =    lhs[idx]\n                                '
        require(isinstance(stmt, ir.SetItem))
        require(isinstance(stmt.value, ir.Var))
       ...

What's a good function header?
assistant
#Here is Python program to find    numpy    array    definition    such    as\n                                                arr    =    numba.

def _fix_nested_array(func_ir):