
    D_i                     T    S r SSKJr  SSSS.S\S\S\\\/\4   S\S	\S
\S\4S jjrg)zUsage utilities.    )Callabled   defaultdepth	max_depthleftrightopr   r   r   returnc          
         XE:  a  SU< S3n[        U5      e0 n[        U 5      R                  U5       GH)  n[        U R	                  X5      [
        5      (       aO  [        UR	                  X5      [
        5      (       a+  U" U R	                  X5      UR	                  X5      5      Xx'   Mw  [        U R	                  U0 5      [        5      (       aZ  [        UR	                  U0 5      [        5      (       a5  [        U R	                  U0 5      UR	                  U0 5      UUUS-   US9Xx'   M  X4 V	s/ s H  oU	;   d  M
  [        X   5      PM     n
n	SU
 S3n[        U5      e   U$ s  sn	f )a  Apply an integer operation to corresponding values in two dictionaries.

Recursively combines two dictionaries by applying the given operation to integer
values at matching keys.

Supports nested dictionaries.

Args:
    left: First dictionary to combine.
    right: Second dictionary to combine.
    op: Binary operation function to apply to integer values.
    default: Default value to use when a key is missing from a dictionary.
    depth: Current recursion depth (used internally).
    max_depth: Maximum recursion depth (to prevent infinite loops).

Returns:
    A new dictionary with combined values.

Raises:
    ValueError: If `max_depth` is exceeded or if value types are not supported.
z
max_depth=z# exceeded, unable to combine dicts.   r   zUnknown value types: z). Only dict and int values are supported.)	
ValueErrorsetunion
isinstancegetintdict_dict_int_optype)r	   r
   r   r   r   r   msgcombinedkdtypess              T/home/james-whalen/.local/lib/python3.13/site-packages/langchain_core/utils/usage.pyr   r      sF   < ?@oHY__U#dhhq*C00ZIIa!36
 6
 TXXa1599Q3HIHKB..:eii2>NPT3U3U&B		!R ai#HK +/AAq&ZT!$ZEA'w.WX  S/!' $( O Bs   /	E$<E$N)__doc__collections.abcr   r   r   r        r   <module>r"      sj     $ 6
66 	#sS!6
 6 6 6 
6r!   