a
    zn„f·  ã                   @  sP   d Z ddlmZ ddlZddlZdd„ Zdd„ e ejj	¡D ƒe_
g d¢e_dS )	zØ
This module defines utilities for adding behaviors to C++ objects in Python.
Behaviors are defined by specially named classes in specially named modules
that get auto-detected by :doc:`uproot.behavior.behavior_of`.
é    )ÚannotationsNc                 C  sà   t j | ¡}| d¡sJ ‚|dd… }d}tjD ](}| |¡r0|}|dt|ƒ … } qZq0|tƒ vr´|tj	v r´t
td|› �ddƒtƒ ƒ td|› �ƒ}t||dƒ}|dur´|tƒ |< tƒ  |¡}|du sÐ|du rÔ|S ||ƒS dS )aû  
    Finds and loads the behavior class for C++ (decoded) classname or returns
    None if there isn't one.

    Behaviors do not have a required base class, and they may be used with
    Awkward Array's ``ak.behavior``.

    The search strategy for finding behavior classes is:

    1. Translate the ROOT class name from C++ to Python with
       :doc:`uproot.model.classname_encode`. For example,
       ``"ROOT::RThing"`` becomes ``"Model_ROOT_3a3a_RThing"``.
    2. Look for a submodule of ``uproot.behaviors`` without
       the ``"Model_"`` prefix. For example, ``"ROOT_3a3a_RThing"``.
    3. Look for a class in that submodule with the fully encoded
       name. For example, ``"Model_ROOT_3a3a_RThing"``.

    See :doc:`uproot.behaviors` for details.
    ZModel_é   Nzimport uproot.behaviors.z	<dynamic>Úexeczuproot.behaviors.)ÚuprootÚmodelZclassname_encodeÚ
startswithÚbehavior_ofÚ_specializationsÚendswithÚlenÚglobalsÚ_module_namesr   ÚcompileÚevalÚgetattrÚget)Ú	classnameÚnameZspecializationÚparamÚmoduleZbehavior_clsÚcls© r   úR/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/uproot/behavior.pyr      s,    

þ
r   c                 C  s   g | ]\}}}|‘qS r   r   )Ú.0ÚloaderÚmodule_nameZis_pkgr   r   r   Ú
<listcomp>@   s   ÿr   )Z_3c_bool_3e_Z_3c_char_3e_Z_3c_unsigned_20_char_3e_Z_3c_short_3e_Z_3c_unsigned_20_short_3e_Z_3c_int_3e_Z_3c_unsigned_20_int_3e_Z_3c_long_3e_Z_3c_unsigned_20_long_3e_Z_3c_long_20_long_3e_Z _3c_unsigned_20_long_20_long_3e_Z_3c_size_5f_t_3e_Z_3c_ssize_5f_t_3e_Z_3c_float_3e_Z_3c_double_3e_Z_3c_long_20_double_3e_Z_3c_Bool_5f_t_3e_Z_3c_Char_5f_t_3e_Z_3c_UChar_5f_t_3e_Z_3c_Short_5f_t_3e_Z_3c_UShort_5f_t_3e_Z_3c_Int_5f_t_3e_Z_3c_UInt_5f_t_3e_Z_3c_Long_5f_t_3e_Z_3c_ULong_5f_t_3e_Z_3c_Long64_5f_t_3e_Z_3c_ULong64_5f_t_3e_Z_3c_Size_5f_t_3e_Z_3c_Float_5f_t_3e_Z_3c_Double_5f_t_3e_Z_3c_LongDouble_5f_t_3e_)Ú__doc__Ú
__future__r   ÚpkgutilZuproot.behaviorsr   r   Úwalk_packagesZ	behaviorsÚ__path__r   r	   r   r   r   r   Ú<module>   s   1þ