#NEWLINE# def assign_id_to_src( src_name , src_value ) : #NEWLINE# #INDENT# if isinstance ( src_value , six . string_types ) : #NEWLINE# #INDENT# src_id = src_value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# src_id = src_value . id #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# err = '{0} does not have an `id` property. {1} needs to be assigned to either an object with an `id` (like a plotly.grid_objs.Column) or a string. The `id` is a unique identifier assigned by the Plotly webserver to this grid column.' #NEWLINE# src_value_str = str ( src_value ) #NEWLINE# err = err . format ( src_name , src_value_str ) #NEWLINE# raise exceptions . InputError ( err ) #NEWLINE# #UNINDENT# #UNINDENT# if ( src_id == '' ) : #NEWLINE# #INDENT# err = exceptions . COLUMN_NOT_YET_UPLOADED_MESSAGE #NEWLINE# err . format ( column_name = src_value . name , reference = src_name ) #NEWLINE# raise exceptions . InputError ( err ) #NEWLINE# #UNINDENT# return src_id