Format: application/x-python-code
⬇ Download File (1.4 KB)
   1  o
   2  
   3  �h$�@s2dZddlZddlmZddlmZddd�ZdS)	z0Simple function for embedding an IPython kernel
   4  �N)�extract_module_locals�)�IPKernelAppcKs�t��r	t��}ntjdi|��}|�g�|jjj}|dur'|tj|jjj	<t
   5  d�\}}|dur3|}|dur9|}||j_||j_|j�
   6  �|��dS)aEmbed and start an IPython kernel in a given scope.
   7  
   8      Parameters
   9      ----------
  10      module : ModuleType, optional
  11          The module to load into IPython globals (default: caller)
  12      local_ns : dict, optional
  13          The namespace to load into IPython user namespace (default: caller)
  14      kwargs : dict, optional
  15          Further keyword args are relayed to the IPKernelApp constructor,
  16          allowing configuration of the Kernel.  Will only have an effect
  17          on the first embed_kernel call for a given process.
  18  
  19      Nr�)rZinitialized�instanceZ
  20  initializeZkernel�shellZ_orig_sys_modules_main_mod�sys�modulesZ_orig_sys_modules_main_namerZuser_moduleZuser_nsZset_completer_frame�start)�moduleZlocal_ns�kwargsZapp�mainZ
  21  caller_moduleZ
  22  caller_localsrr�Ec:\Users\shubh\Videos\agent\nova\Lib\site-packages\ipykernel/embed.py�embed_kernels 
  23  
  24  
  25  
  26  r)NN)�__doc__rZIPython.utils.framerZ	kernelapprrrrrr�<module>s
  27