<s> """<STR_LIT>""" <EOL> import json <EOL> class PlotlyError ( Exception ) : <EOL> pass <EOL> class InputError ( PlotlyError ) : <EOL> pass <EOL> class PlotlyRequestError ( PlotlyError ) : <EOL> def __init__ ( self , requests_exception ) : <EOL> self . status_code = requests_exception . response . status_code <EOL> self . HTTPError = requests_exception <EOL> content_type = requests_exception . response . headers [ '<STR_LIT>' ] <EOL> if '<STR_LIT>' in content_type : <EOL> content = requests_exception . response . content <EOL> if content != '<STR_LIT>' : <EOL> res_payload = json . loads ( <EOL> requests_exception . response . content . decode ( '<STR_LIT:utf8>' ) <EOL> ) <EOL> if '<STR_LIT>' in res_payload : <EOL> self . message = res_payload [ '<STR_LIT>' ] <EOL> else : <EOL> self . message = '<STR_LIT>' <EOL> else : <EOL> self . message = '<STR_LIT>' <EOL> elif content_type == '<STR_LIT>' : <EOL> self . message = requests_exception . response . content <EOL> else : <EOL> try : <EOL> self . message = requests_exception . message <EOL> except AttributeError : <EOL> self . message = '<STR_LIT>' <EOL> def __str__ ( self ) : <EOL> return self . message <EOL> COLUMN_NOT_YET_UPLOADED_MESSAGE = ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) <EOL> NON_UNIQUE_COLUMN_MESSAGE = ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) <EOL> class PlotlyEmptyDataError ( PlotlyError ) : <EOL> pass <EOL> class PlotlyGraphObjectError ( PlotlyError ) : <EOL> def __init__ ( self , message = '<STR_LIT>' , path = ( ) , notes = ( ) ) : <EOL> """<STR_LIT>""" <EOL> self . message = message <EOL> self . plain_message = message <EOL> self . path = list ( path ) <EOL> self . notes = notes <EOL> super ( PlotlyGraphObjectError , self ) . __init__ ( message ) <EOL> def __str__ ( self ) : <EOL> """<STR_LIT>""" <EOL> format_dict = { <EOL> '<STR_LIT:message>' : self . message , <EOL> '<STR_LIT:path>' : '<STR_LIT:[>' + '<STR_LIT>' . join ( repr ( k ) for k in self . path ) + '<STR_LIT:]>' , <EOL> '<STR_LIT>' : '<STR_LIT:\n>' . join ( self . notes ) <EOL> } <EOL> return ( '<STR_LIT>' <EOL> . format ( ** format_dict ) ) <EOL> class PlotlyDictKeyError ( PlotlyGraphObjectError ) : <EOL> def __init__ ( self , obj , path , notes = ( ) ) : <EOL> """<STR_LIT>""" <EOL> format_dict = { '<STR_LIT>' : path [ - <NUM_LIT:1> ] , '<STR_LIT:object_name>' : obj . _name } <EOL> message = ( "<STR_LIT>" <EOL> . format ( ** format_dict ) ) <EOL> notes = [ obj . help ( return_help = True ) ] + list ( notes ) <EOL> super ( PlotlyDictKeyError , self ) . __init__ ( <EOL> message = message , path = path , notes = notes <EOL> ) <EOL> class PlotlyDictValueError ( PlotlyGraphObjectError ) : <EOL> def __init__ ( self , obj , path , notes = ( ) ) : <EOL> """<STR_LIT>""" <EOL> format_dict = { '<STR_LIT>' : path [ - <NUM_LIT:1> ] , '<STR_LIT:object_name>' : obj . _name } <EOL> message = ( "<STR_LIT>" <EOL> . format ( ** format_dict ) ) <EOL> notes = [ obj . help ( path [ - <NUM_LIT:1> ] , return_help = True ) ] + list ( notes ) <EOL> super ( PlotlyDictValueError , self ) . __init__ ( <EOL> message = message , notes = notes , path = path <EOL> ) <EOL> class PlotlyListEntryError ( PlotlyGraphObjectError ) : <EOL> def __init__ ( self , obj , path , notes = ( ) ) : <EOL> """<STR_LIT>""" <EOL> format_dict = { '<STR_LIT:index>' : path [ - <NUM_LIT:1> ] , '<STR_LIT:object_name>' : obj . _name } <EOL> message = ( "<STR_LIT>" <EOL> . format ( ** format_dict ) ) <EOL> notes = [ obj . help ( return_help = True ) ] + list ( notes ) <EOL> super ( PlotlyListEntryError , self ) . __init__ ( <EOL> message = message , path = path , notes = notes <EOL> ) <EOL> class PlotlyDataTypeError ( PlotlyGraphObjectError ) : <EOL> def __init__ ( self , obj , path , notes = ( ) ) : <EOL> """<STR_LIT>""" <EOL> format_dict = { '<STR_LIT:index>' : path [ - <NUM_LIT:1> ] , '<STR_LIT:object_name>' : obj . _name } <EOL> message = ( "<STR_LIT>" <EOL> . format ( ** format_dict ) ) <EOL> note = "<STR_LIT>" <EOL> notes = [ note ] + list ( notes ) <EOL> super ( PlotlyDataTypeError , self ) . __init__ ( <EOL> message = message , path = path , notes = notes <EOL> ) <EOL> class PlotlyLocalError ( PlotlyError ) : <EOL> pass <EOL> class PlotlyLocalCredentialsError ( PlotlyLocalError ) : <EOL> def __init__ ( self ) : <EOL> message = ( <EOL> "<STR_LIT:\n>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) <EOL> super ( PlotlyLocalCredentialsError , self ) . __init__ ( message ) <EOL> class PlotlyServerError ( PlotlyError ) : <EOL> pass <EOL> class PlotlyConnectionError ( PlotlyServerError ) : <EOL> pass <EOL> class PlotlyCredentialError ( PlotlyServerError ) : <EOL> pass <EOL> class PlotlyAccountError ( PlotlyServerError ) : <EOL> pass <EOL> class PlotlyRateLimitError ( PlotlyServerError ) : <EOL> pass </s>
