o
    j6h	                     @  sh   d dl mZ d dlZd dlZd dlZd dlZd dlZdd Zdd Zdd Z	e
 Ze d	d
 ZdS )    )annotationsNc                   s    fdd}|S )z/A decorator to set the docstring of a function.c                   s
    | _ | S N)__doc__)fdoc o/var/www/html/chefvision.cloud.itp360.com/venv/lib/python3.10/site-packages/google/generativeai/string_utils.pyinner   s   zset_doc.<locals>.innerr   )r   r
   r   r   r	   set_doc   s   r   c                 C  s.   |   }dd |D }dd |D }d|S )Nc                 S     g | ]}d |vr|qS )z
.. _oneof:r   .0liner   r   r	   
<listcomp>$       zstrip_oneof.<locals>.<listcomp>c                 S  r   )z"This field is a member of `oneof`_r   r   r   r   r	   r   %   r   
)
splitlinesjoin)	docstringlinesr   r   r	   strip_oneof"   s   
r   c                 C  s   t | _t | _| S r   )_prettyprint__str____repr__)clsr   r   r	   prettyprint)   s   r   c                 C  s  g }t | D ]X}tt| |j}d}|ddkrB|dr#d}n1|dr+d}n)tj	||tj
dr?tj|d	|tj
d}nd
}nt|jd }t|d| d}||j d|  qd|}| jj}t|d }t|d| d}| d| dS )aS  A dataclass prettyprint function you can use in __str__or __repr__.

    Note: You can't set `__str__ = pprint.pformat` because it causes a recursion error.

    Mostly identical to pprint but:

    * This will contract long lists and dicts (> 10lines) to [...] and {...}.
    * This will contract long object reprs to ClassName(...).
    z^(\w+)\(.*\)$r   
   [z[...]{z{...})flagsz\1(...)z...    =z,
())dataclassesfieldspprintpformatgetattrnamecount
startswithrematchDOTALLsublentextwrapindentlstripappendr   	__class____name__)selfr'   r   sclass_rewidthattrsr+   r   r   r	   r   2   s(   


r   )
__future__r   r&   r(   r.   reprlibr3   r   r   r   Reprreprrecursive_reprr   r   r   r   r	   <module>   s   
