o
    i                     @  sb   d dl mZ d dlZd dlmZ d dlmZ d dlmZ er$d dlm	Z	 dddZ
ddddZdS )    )annotationsNunparse)TYPE_CHECKING)logger)Pathnodeast.AST | Nonereturn
str | Nonec                 C  s   | du rdS t | S )zGet the string representation of a node.

    Parameters:
        node: The node to represent.

    Returns:
        The representing code for the node.
    Nr   )r    r   j/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/griffe/_internal/agents/nodes/values.py	get_value   s   	r   filepathstr | Path | Nonec              
   C  sn   zt | W S  ty6 } z%d|  }|r|d| d| j 7 }|d| 7 }t| W Y d}~dS d}~ww )zSafely (no exception) get the string representation of a node.

    Parameters:
        node: The node to represent.
        filepath: An optional filepath from where the node comes.

    Returns:
        The representing code for the node.
    zFailed to represent node z at :z: N)r   	Exceptionlinenor   	exception)r   r   errormessager   r   r   safe_get_value   s   



r   )r   r	   r
   r   )N)r   r	   r   r   r
   r   )
__future__r   astr   typingr   griffe._internal.loggerr   pathlibr   r   r   r   r   r   r   <module>   s   
