
    6bi                        S r SSKrSSKrSSKrSSKrSSKrSSKJs  Jr	  \R                  R                  \R                  R                  \SS5      5      \R                  R                  SS5      4rS rS rS rSS	 jrS
 rg)z@Utilities related to TF-Keras exception stack trace prettifying.    Nz..
tensorflowpythonc                 ,    [          H
  nX;   d  M
    g   g)NFT)_EXCLUDED_PATHS)fname	exclusions     \/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/utils/traceback_utils.pyinclude_framer
      s    $	 %     c                 f   Sn[        [        R                  " U 5      5      n[        U5       HM  u  p4[	        UR
                  R                  5      (       d  M+  [        R                  " XUR                  U5      nMO     Uc0  U(       a)  US   u  p4[        R                  " XUR                  U5      nU$ )zFIterate through traceback frames and return a new, filtered traceback.N)
list	tracebackwalk_tbreversedr
   f_codeco_filenametypesTracebackTypef_lasti)tblast_tbtb_listfline_nos        r	   _process_traceback_framesr   &   s    G9$$R()Gw'
--..))'aiiIG ( 7 R[
%%g!))WENr   c                    ^  [         R                  R                  S:w  d  [         R                  R                  S:  a  T $ U 4S jn[        R
                  R                  R                  T U5      $ )zHFilter out Keras-internal stack trace frames in exceptions raised by
fn.      c                     > [         R                  R                  5       (       d  T" U 0 UD6$ S n T" U 0 UD6A$ ! [         a,  n[	        UR
                  5      nUR                  U5      S eS nAff = f! Af = fN)tf	debuggingis_traceback_filtering_enabled	Exceptionr   __traceback__with_traceback)argskwargsfiltered_tbefns       r	   error_handler'filter_traceback.<locals>.error_handler;   s}    ||::<<t&v&&	t&v&   	:3AOODK "";/T9		: s!   9 
A/'A**A//A2 2A5)sysversion_infomajorminorr"   __internal__	decoratormake_decorator)r,   r-   s   ` r	   filter_tracebackr6   5   sU     "c&6&6&<&<q&@	 ??$$33BFFr   c                 h   ^ ^ U U4S jn[         R                  R                  R                  T U5      $ )a  Add information about call argument values to an error message.

Arguments:
  fn: Function to wrap. Exceptions raised by the this function will be
    re-raised with additional information added to the error message,
    displaying the values of the different arguments that the function
    was called with.
  object_name: String, display name of the class/function being called,
    e.g. `'layer "layer_name" (LayerClass)'`.

Returns:
  A wrapped version of `fn`.
c            	        > S nS n T" U 0 UD6AA$ ! [          GaF  n[        US5      (       a  Ue[        R                  " T5      n UR                  " U 0 UD6nO! [
         a    Uef = f/ n[        UR                  R                  5       5       H  nUR                  UR                  ;   a<  [        R                  R                  [        UR                  UR                     5      nOUR                  nUR!                  SUR                   SU 35        M     U(       Ga  SR#                  U5      n[%        U[        R&                  R(                  5      (       a  UR*                  nO#UR,                  (       a  UR,                  S   nOSnT(       a  TOTR.                   n	SU	 SU S	U	 S
U 3n[%        U[        R&                  R(                  5      (       a2  UR1                  UR2                  UR4                  XR6                  5      n
O. UR1                  U5      n
O! [
         a    [9        U5      n
 Of = fSU
l        OUn
U
R=                  UR>                  5      S eS nAff = f! AAf = f)N_keras_call_info_injectedu     • =
r    z#Exception encountered when calling z.

z

Call arguments received by z:
T) r%   hasattrinspect	signaturebind	TypeErrorr   
parametersvaluesname	argumentsr"   nestmap_structureformat_argument_valuedefaultappendjoin
isinstanceerrorsOpErrormessager(   __name__	__class__node_defop
error_codeRuntimeErrorr9   r'   r&   )r(   r)   r?   bound_signaturer+   arguments_contextargvaluerO   display_namenew_er,   object_names              r	   r-   8inject_argument_info_in_traceback.<locals>.error_handler\   s9   	?	 t&v&z {  :	Bq566))"-I"+..$"A&"A 
 !#I00779:88888GG11-'11#((;E
  KKE!((6#((1UG)DE ; !$(II.?$@!a!2!233iiGVV  ffQiG G1<+"++!N9,ui  22>s()+  a!2!233KK

ADD'<<PE6 !"G 4$ 6 !-W 56 37/&&q7TAu:	Bx s]    I")IAIA&&F#I
HIH41I3H44)II""I% %I))r"   r3   r4   r5   )r,   r\   r-   s   `` r	   !inject_argument_info_in_tracebackr^   M   s)    B H ??$$33BFFr   c                     [        U [        R                  5      (       a'  SU R                   SU R                  R
                   S3$ [        U 5      $ )Nztf.Tensor(shape=z, dtype=))rL   r"   TensorshapedtyperD   repr)rY   s    r	   rH   rH      sC    %## "%++hu{{7G7G6HJJ;r   r!   )__doc__r>   osr/   r   r   tensorflow.compat.v2compatv2r"   pathabspathrK   __file__r   r
   r   r6   r^   rH    r   r	   <module>rn      sy    G  	 
   ! ! GGOOBGGLL467GGLLx(G0SGlr   