
    ~Wh                        d Z ddlZddlZddlZddlZddlZddlmc mZ	 ej
                            ej
                            edd                    ej
                            dd          fZd Zd Zd Zdd	Zd
 ZdS )z=Utilities related to Keras exception stack trace prettifying.    Nz..
tensorflowpythonc                 (    t           D ]	}|| v r dS 
dS )NFT)_EXCLUDED_PATHS)fname	exclusions     a/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/keras/utils/traceback_utils.pyinclude_framer
      s-    $  	55 4    c                 6   d}t          t          j        |                     }t          |          D ]:\  }}t	          |j        j                  rt          j        |||j	        |          };|)|r'|d         \  }}t          j        |||j	        |          }|S )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'' J J
7-.. 	J)'1aiIIG7 R[
7%gq!)WEENr   c                      t           j        j        dk    st           j        j        dk     r S  fd}t          j        j                             |          S )zLFilter out Keras-internal stack trace frames in exceptions raised by
    fn.      c                      t           j                                        s | i |S d }	  | i |~S # t          $ r/}t	          |j                  }|                    |          d d }~ww xY w# ~w xY wN)tf	debuggingis_traceback_filtering_enabled	Exceptionr   __traceback__with_traceback)argskwargsfiltered_tbefns       r	   error_handlerz'filter_traceback.<locals>.error_handler;   s    |::<< 	'2t&v&&&	2t&v&&   	: 	: 	:3AODDK "";//T9		: OOOOs    4 
A-*A((A--A0 0A3)sysversion_infomajorminorr"   __internal__	decoratormake_decorator)r,   r-   s   ` r	   filter_tracebackr5   5   sa     ""c&6&<q&@&@	     ?$33BFFFr   c                 \      fd}t           j        j                             |          S )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            	      .   d }d }	  | i |~~S # t           $ r}t          |d          r|t          j                  }	  |j        | i |}n# t
          $ r |w xY wg }t          |j                                                  D ]m}|j	        |j
        v r6t          j                            t          |j
        |j	                           }n|j        }|                    d|j	         d|            n|rd                    |          }t%          |t          j        j                  r|j        }n|j        r|j        d         }nd}rnj         }	d|	 d| d	|	 d
| }t%          |t          j        j                  r(|                    |j        |j        ||j                  }
n6	 |                    |          }
n# t
          $ r t9          |          }
Y nw xY wd|
_        n|}
|
                    |j                  d d }~ww xY w# ~~w xY w)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RuntimeErrorr8   r'   r&   )r(   r)   r>   bound_signaturer+   arguments_contextargvaluerN   display_namenew_er,   object_names              r	   r-   z8inject_argument_info_in_traceback.<locals>.error_handler\   s   	?	 2t&v&&z {  :	B :	B :	Bq566 )"--I"0).$"A&"A"A   
 !#I07799:: F F8888G11-'1#(; EE
  KE!(()D#()D)DU)D)DEEEE  !$(II.?$@$@!a!233 !iGGV !  fQiGG G1<"M++"+O+, + ++ +2>+ + )+ +  a!233 
6KK
AD'1<PPEE6 !"G 4 4$ 6 6 6 !-W 5 56 37//&&q77TAu:	Bx s]    H&HAHAEH.GHG HG  (HHH H)r"   r2   r3   r4   )r,   r[   r-   s   `` r	   !inject_argument_info_in_tracebackr\   M   sF    B  B  B  B  B  B H ?$33BFFFr   c                     t          | t          j                  rd| j         d| j        j         dS t          |           S )Nztf.Tensor(shape=z, dtype=))rK   r"   TensorshapedtyperC   repr)rX   s    r	   rG   rG      sF    %## K K%+JJu{7GJJJJ;;r   r!   )__doc__r=   osr.   r   r   tensorflow.compat.v2compatv2r"   pathabspathrJ   __file__r   r
   r   r5   r\   rG    r   r	   <module>rl      s    D C  				 



      ! ! ! ! ! ! ! ! ! GOOBGLL46677GLLx((    G G G0SG SG SG SGl    r   