+L iY fddlmZddlZddlmZddlmZdZdZ de dee fdZ efd Z y) )ListN)get_plotlyjs_versioncZddlm}t||r|j}|St|tr5|r/t j j|j}|S|}|St|dr|j}|Stdjt||)Nr) BaseFigureto_plotly_jsonzR The fig parameter must be a dict or Figure. Received value of type {typ}: {v})typv) plotly.basedatatypesr isinstanceto_dictdictplotly graph_objsFigurerhasattr ValueErrorformattype)figvalidaterfig_dicts V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/plotly/io/_utils.pyvalidate_coerce_fig_to_dictrs/#z";;= O C  ((//4CCEH OH O & '%%' O  ))/DI)E  c|dk(s|tjk(rtj}|S|dk(s#ttdr%|tjk(rtj}|St d)Nr FigureWidgetzP Invalid output type: {output_type} Must be one of: 'Figure', 'FigureWidget')gorrrr) output_typeclss rvalidate_coerce_output_typer shh+":ii J  &N# r(Foo J  0  rkwargsreturnc t|jDcgc]}t|tst | }}|r"t t |dkDr t d|r|dnd}|jDcic]\}}|t|ts|g|zn| }}}t|Dcgc])}|jDcic] \}}||| c}}+}}}}|Scc}wcc}}wcc}}wcc}}}w)a Given one or more keyword arguments which may be either a single value or a list of values, return a list of keyword dictionaries by broadcasting the single valuesacross all the dicts. If more than one item in the input is a list, all lists must be the same length. Parameters ---------- **kwargs: dict The keyword arguments Returns ------- list of dicts A list of dictionaries Raises ------ ValueError If any of the input lists are not the same length z-All list arguments must have the same length.r) tuplevaluesr listlensetritemsrange)r!r list_lengths list_lengthkexpanded_kwargsilist_of_kwargss rbroadcast_args_to_dictsr2.s0%*&--/$:RqjD>QCFRLRC -.2HII%1,q/qK LLN Aq Jq$$7A3 Q>O@E[?Q:;_2245TQAaD5N !S  6s(C* C*#C/6C;C5C;5C;c&dj|S)zReturn a valid plotly CDN url.z+https://cdn.plot.ly/plotly-{cdn_ver}.min.jscdn_ver)rr4s rplotly_cdn_urlr6Ys 8 ? ? @ r) typingrrplotly.graph_objsrrplotly.offlinerrr r r2r6rrr;s@ /,  (d(tDz(V01r