U
    e»{j¹
  ã                   @   sF   d ddgZ i ZG dd „ d eƒZddd„Zdd„ Zdd„ Zed	eƒ d
S )ÚMixinRegistryErrorÚregister_mixin_handlerÚget_mixin_handlerc                   @   s   e Zd ZdS )r   N)Ú__name__Ú
__module__Ú__qualname__© r   r   ú\/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/table/mixins/registry.pyr      s   Fc                 C   s*   | t ks|r|t | < ntd| › d�ƒ‚dS )aG  
    Register a mixin column 'handler'.

    A mixin column handler is a function that given an arbitrary Python object,
    will return an object with the .info attribute that can then be used as a
    mixin column (this can be e.g. a copy of the object with a new attribute,
    a subclass instance, or a wrapper class - this is left up to the handler).

    The handler will be used on classes that have an exactly matching fully
    qualified name.

    Parameters
    ----------
    fully_qualified_name : str
        The fully qualified name of the class that the handler can operate on,
        such as e.g. ``dask.array.core.Array``.
    handler : func
        The handler function.
    force : bool, optional
        Whether to overwrite any previous handler if there is already one for
        the same fully qualified name.
    zHandler for class z is already definedN)Ú	_handlersr   )Zfully_qualified_nameÚhandlerÚforcer   r   r   r      s
    

ÿc                 C   s6   t | tƒrt | d¡S t | jjd | jj d¡S dS )a9  
    Given an arbitrary object, return the matching mixin handler (if any).

    Parameters
    ----------
    obj : object or str
        The object to find a mixin handler for, or a fully qualified name.

    Returns
    -------
    handler : None or func
        Then matching handler, if found, or `None`
    NÚ.)Ú
isinstanceÚstrr	   ÚgetÚ	__class__r   r   )Úobjr   r   r   r   1   s    
 ÿc                 C   s   ddl m} || ƒS )Né    )Úas_dask_column)Zastropy.table.mixins.daskr   )Zarrr   r   r   r   Údask_handlerL   s    r   zdask.array.core.ArrayN)F)Ú__all__r	   Ú	Exceptionr   r   r   r   r   r   r   r   Ú<module>   s   

