o
    ho                     @   s`   d dl mZmZmZmZ d dlmZ erd dlmZ dZ	dede
fddZd	edd
fddZdS )    )AnycastSetTYPE_CHECKING)isclassRenderableTypeZ-aihwerij235234ljsdnp34ksodfipwoe234234jlskjdfcheck_objectreturnc                 C   s   t | tpt| dpt| dS )z+Check if an object may be rendered by Rich.__rich__Z__rich_console__)
isinstancestrhasattr)r	    r   _/home/www/facesmatcher.com/frenv_anti/lib/python3.10/site-packages/pip/_vendor/rich/protocol.pyis_renderable
   s
   
r   
renderabler   c                 C   s~   ddl m} t }t| dr:t| s:t| trt| S t| d}| } t| }||v r,q:|	| t| dr:t| rt
|| S )zCast an object to a renderable by calling __rich__ if present.

    Args:
        renderable (object): A potentially renderable object

    Returns:
        object: The result of recursively calling __rich__.
    r   r   r   )pip._vendor.rich.consoler   setr   r   
_GIBBERISHreprgetattrtypeaddr   )r   r   Zrich_visited_setZcast_methodZrenderable_typer   r   r   	rich_cast   s   	



r   N)typingr   r   r   r   inspectr   r   r   r   boolr   objectr   r   r   r   r   <module>   s    	