o
    b²“i  ã                   @   s,   d dl Z dd„ Zdd„ Zdd„ Zdd	„ ZdS )
é    Nc                 C   s$   dd„ }|| ƒpt | dƒo|| jƒS )z1Check if an object is a Cython function or methodc                 S   s   t | ƒjdkS )NÚcython_function_or_method)ÚtypeÚ__name__)Úx© r   úM/home/ubuntu/.local/lib/python3.10/site-packages/ray/_private/inspect_util.pyÚcheck_cython   s   zis_cython.<locals>.check_cythonÚ__func__)Úhasattrr	   )Úobjr   r   r   r   Ú	is_cython   s   ÿr   c                 C   s   t  | ¡pt  | ¡pt| ƒS )zªCheck if an object is a function or method.

    Args:
        obj: The Python object in question.

    Returns:
        True if the object is an function or method.
    )ÚinspectÚ
isfunctionÚismethodr   )r   r   r   r   Úis_function_or_method   s   	r   c                 C   s   t | dƒo	| jduS )z3Returns whether the given method is a class_method.Ú__self__N)r
   r   )Úfr   r   r   Úis_class_method    s   r   c                 C   s2   t  | ¡D ]}||jv rt|j| tƒ  S qdS )a)  Returns whether the class has a static method with the given name.

    Args:
        cls: The Python class (i.e. object of type `type`) to
            search for the method in.
        f_name: The name of the method to look up in this class
            and check whether or not it is static.
    F)r   ÚgetmroÚ__dict__Ú
isinstanceÚstaticmethod)ÚclsÚf_nameÚbase_clsr   r   r   Úis_static_method%   s
   	
ÿr   )r   r   r   r   r   r   r   r   r   Ú<module>   s
    