
    VfO              	       r   d Z ddlmZ ddlZddlZddlZi i i dZej                  ej                  ej                  ej                  e	dZ
ej                  ej                  ej                  eeeeej                  dZej                  ej                  eeeej                  dZg dZd	 Zd
 Zd Zd Zd Zy)z
The session module handles the user's current credentials, config and plot opts

This allows users to dynamically change which plotly domain they're using,
which user they're signed in as, and plotting defaults.

    )absolute_importN)credentialsconfigplot_options)usernameapi_keyproxy_usernameproxy_password
stream_ids)plotly_domainplotly_streaming_domainplotly_api_domainplotly_ssl_verificationplotly_proxy_authorizationworld_readable	auto_opensharing)filenamefileoptvalidater   r   r   )publicprivatesecretc                 h   |j                  | |       |D ]A  }|t        vs|t        vst        j                  j                  dj                  |             t        D ]b  }||v st        ||   t        |         s6t        j                  j                  dj                  |t        |               ||   t        d   |<   d t        D ]n  }||v st        ||   t        |         s6t        j                  j                  dj                  |t        |               |j                  |      t        d   |<   p t        D ]n  }||v st        ||   t        |         s6t        j                  j                  dj                  |t        |               |j                  |      t        d   |<   p y)a-  
    Set set session credentials and config (not saved to file).

    If unspecified, credentials and config are searched for in `.plotly` dir.

    :param (str) username: The username you'd use to sign in to Plotly
    :param (str) api_key: The api key associated with above username
    :param (list|optional) stream_ids: Stream tokens for above credentials
    :param (str|optional) proxy_username: The un associated with with your Proxy
    :param (str|optional) proxy_password: The pw associated with your Proxy un

    :param (str|optional) plotly_domain:
    :param (str|optional) plotly_streaming_domain:
    :param (str|optional) plotly_api_domain:
    :param (bool|optional) plotly_ssl_verification:
    :param (bool|optional) plotly_proxy_authorization:
    :param (bool|optional) world_readable:

    )r   r   z+{} is not a valid config or credentials key{} must be of type '{}'r   r   r   N)updateCREDENTIALS_KEYSCONFIG_KEYS_plotly_utils
exceptionsPlotlyErrorformat
isinstance_sessiongetPLOT_OPTIONS)r   r   kwargskeys       ]/var/www/html/software/conda/envs/catlas/lib/python3.12/site-packages/chart_studio/session.pysign_inr*   2   s   . MM8WM5  &&3k+A**66=DDSI    7&=fSk+;C+@A#..::-44S:J3:OP  ,2#;H]#C(7  6&=fSk;s+;<#..::-44S+c:JK  '-jjoHXs#6  <&=fSk;s+;<#..::-44S+c:JK  -3JJsOH^$S)<    c                     | D ]  }|t         vr.t        j                  j                  dj	                  |            t        | |   t         |         s6t        j                  j                  dj	                  |t         |               |dk(  s| |   t        vst        j                  j                   dj                  |gt                t        d   j                  |        y)a  
    Update the _session plot_options

    :param (str|optional) filename: What the file will be named in Plotly
    :param (str|optional) fileopt: 'overwrite', 'append', 'new', or 'extend'
    :param (bool|optional) world_readable: Make public or private.
    :param (dict|optional) sharing: 'public', 'private', 'secret'
    :param (bool|optional) auto_open: For `plot`, open in new browser tab?
    :param (bool|optional) validate: Error locally if data doesn't pass?

    z+{} is not a valid config or plot option keyr   r   z-'{0}' must be of either '{1}', '{2}' or '{3}'r   N)	r&   r   r    r!   r"   r#   SHARING_OPTIONSr$   r   )r'   r(   s     r)   update_session_plot_optionsr.   n   s      l"**66=DDSI  &+|C'89**66)00l36GH 
 )VC[O%C**66# "F3:)8: $ ^##F+r+   c                  :    t        j                  t        d         S )zb Returns a copy of the user supplied plot options.
    Use `update_plot_options()` to change.
    r   copydeepcopyr$    r+   r)   get_session_plot_optionsr4      s     ==.122r+   c                  :    t        j                  t        d         S )z,Returns either module config or file config.r   r0   r3   r+   r)   get_session_configr6      s    ==(+,,r+   c                  :    t        j                  t        d         S )z4Returns the credentials that will be sent to plotly.r   r0   r3   r+   r)   get_session_credentialsr8      s    ==-011r+   )__doc__
__future__r   r1   six_plotly_utils.exceptionsr   r$   string_typeslistr   boolr   r&   r-   r*   r.   r4   r6   r8   r3   r+   r)   <module>r@      s    '  
  R@   &&&&  %%"//))#"&	    29<x,D3-
2r+   