
    g                    ^    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Z
d
ddZy)    )annotationsNunparse)TYPE_CHECKING)logger)Pathc                    | yt        |       S )zGet the string representation of a node.

    Parameters:
        node: The node to represent.

    Returns:
        The representing code for the node.
    Nr   )nodes    P/var/www/openai/venv/lib/python3.12/site-packages/_griffe/agents/nodes/values.py	get_valuer      s     |4=    c                    	 t        |       S # t        $ rC}d|  }|r|d| d| j                   z  }|d| z  }t        j                  |       Y d}~yd}~ww xY 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
   filepatherrormessages       r   safe_get_valuer      sl     -dV4hZq66GRw<!s   
 	A9AA)r
   ast.AST | Nonereturn
str | None)N)r
   r   r   zstr | Path | Noner   r   )
__future__r   astr   typingr   _griffe.loggerr   pathlibr   r   r    r   r   <module>r       s&    # 
    !r   