B
    &[_                 @   s4   d dl mZ d dlZd dlmZ dd Zdd ZdS )    )absolute_importNc             C   s`   ddl m} t| |r |  }n<t| trF|r@tj|  }q\| }nt	dj
t| | d|S )Nr   )
BaseFigurezR
The fig parameter must be a dict or Figure.
    Received value of type {typ}: {v})typv)Zplotly.basedatatypesr   
isinstanceZto_dictdictplotly
graph_objsFigureZto_plotly_json
ValueErrorformattype)Zfigvalidater   Zfig_dict r   4/tmp/pip-install-l29rncou/plotly/plotly/io/_utils.pyvalidate_coerce_fig_to_dict   s    


r   c             C   sJ   | dks| t jkrt j}n,| dks6tt dr>| t jkr>t j}ntd|S )Nr
   FigureWidgetzP
Invalid output type: {output_type}
    Must be one of: 'Figure', 'FigureWidget')gor
   hasattrr   r   )output_typeclsr   r   r   validate_coerce_output_type   s    r   )
__future__r   r   Zplotly.graph_objsr	   r   r   r   r   r   r   r   <module>   s   