
    g$                     0    d Z ddlZddlmZ ddlmZ ddZy)z0Simple function for embedding an IPython kernel
    N)extract_module_locals   )IPKernelAppc                    t        j                         rt        j                         }nyt        j                  di |}|j                  g        |j                  j
                  j                  }|1|t        j                  |j                  j
                  j                  <   t        d      \  }}| |} ||}| |j                  _        ||j                  _        |j
                  j                          |j                          y)a  Embed and start an IPython kernel in a given scope.

    Parameters
    ----------
    module : ModuleType, optional
        The module to load into IPython globals (default: caller)
    local_ns : dict, optional
        The namespace to load into IPython user namespace (default: caller)
    kwargs : dict, optional
        Further keyword args are relayed to the IPKernelApp constructor,
        allowing configuration of the Kernel.  Will only have an effect
        on the first embed_kernel call for a given process.

    Nr    )r   initializedinstance
initializekernelshell_orig_sys_modules_main_modsysmodules_orig_sys_modules_main_namer   user_moduleuser_nsset_completer_framestart)modulelocal_nskwargsappmaincaller_modulecaller_localss          /lib/python3.12/site-packages/ipykernel/embed.pyembed_kernelr      s       ""$"",V,r
 zz::HLCKK

((DDE &;1%="]M~ #CJJ!CJJII!!#IIK    )NN)__doc__r   IPython.utils.framer   	kernelappr   r   r   r   r   <module>r"      s     5 "'r   