def sign_in(username, api_key, **kwargs):
 kwargs.update(username=username, api_key=api_key)
 for key in kwargs:
  if ((key not in CREDENTIALS_KEYS) and (key not in CONFIG_KEYS)):
   raise exceptions.PlotlyError('{} is not a valid config or credentials key'.format(key))
 for key in CREDENTIALS_KEYS:
  if (key in kwargs):
   if (not isinstance(kwargs[key], CREDENTIALS_KEYS[key])):
    raise exceptions.PlotlyError("{} must be of type '{}'".format(key, CREDENTIALS_KEYS[key]))
   _session['credentials'][key] = kwargs[key]
 for key in CONFIG_KEYS:
  if (key in kwargs):
   if (not isinstance(kwargs[key], CONFIG_KEYS[key])):
    raise exceptions.PlotlyError("{} must be of type '{}'".format(key, CONFIG_KEYS[key]))
   _session['config'][key] = kwargs.get(key)
 for key in PLOT_OPTIONS:
  if (key in kwargs):
   if (not isinstance(kwargs[key], CONFIG_KEYS[key])):
    raise exceptions.PlotlyError("{} must be of type '{}'".format(key, CONFIG_KEYS[key]))
   _session['plot_options'][key] = kwargs.get(key)

def sign_in ( username , api_key , ** kwargs ) : kwargs . update ( username = username , api_key = api_key ) for key in kwargs : if ( ( key not in CREDENTIALS_KEYS ) and ( key not in CONFIG_KEYS ) ) : raise exceptions . PlotlyError ( '{} is not a valid config or credentials key' . format ( key ) ) for key in CREDENTIALS_KEYS : if ( key in kwargs ) : if ( not isinstance ( kwargs [ key ] , CREDENTIALS_KEYS [ key ] ) ) : raise exceptions . PlotlyError ( "{} must be of type '{}'" . format ( key , CREDENTIALS_KEYS [ key ] ) ) _session [ 'credentials' ] [ key ] = kwargs [ key ] for key in CONFIG_KEYS : if ( key in kwargs ) : if ( not isinstance ( kwargs [ key ] , CONFIG_KEYS [ key ] ) ) : raise exceptions . PlotlyError ( "{} must be of type '{}'" . format ( key , CONFIG_KEYS [ key ] ) ) _session [ 'config' ] [ key ] = kwargs . get ( key ) for key in PLOT_OPTIONS : if ( key in kwargs ) : if ( not isinstance ( kwargs [ key ] , CONFIG_KEYS [ key ] ) ) : raise exceptions . PlotlyError ( "{} must be of type '{}'" . format ( key , CONFIG_KEYS [ key ] ) ) _session [ 'plot_options' ] [ key ] = kwargs . get ( key )
set set session credentials and config .