#NEWLINE# def attribute_path_to_object_names( attribute_container_path ) : #NEWLINE# #INDENT# "\n    Return a location within a figure from a path existing in GRAPH_REFERENCE.\n\n    Users don't need to know about GRAPH_REFERENCE, so yielding information\n    about paths there would only be confusing. Also, the implementation and\n    structure there may change, but figure structure won't.\n\n    :param (tuple[str]) attribute_container_path: An object should exist here.\n\n    :return: (tuple[str]) A tuple of object names:\n\n    Example:\n\n        In: ('traces', 'pie', 'attributes', 'marker')\n        Out: ('figure', 'data', 'pie', 'marker')\n\n    " #NEWLINE# object_names = [ 'figure' ] #NEWLINE# if ( 'layout' in attribute_container_path ) : #NEWLINE# #INDENT# for path_part in attribute_container_path : #NEWLINE# #INDENT# if ( path_part in OBJECTS ) : #NEWLINE# #INDENT# object_names . append ( path_part ) #NEWLINE# #UNINDENT# if ( path_part in ARRAYS ) : #NEWLINE# #INDENT# object_names . append ( path_part ) #NEWLINE# object_names . append ( path_part [ : ( - 1 ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'layoutAttributes' in attribute_container_path ) : #NEWLINE# #INDENT# object_names . append ( 'layout' ) #NEWLINE# start_index = attribute_container_path . index ( 'layoutAttributes' ) #NEWLINE# for path_part in attribute_container_path [ start_index : ] : #NEWLINE# #INDENT# if ( path_part in OBJECTS ) : #NEWLINE# #INDENT# object_names . append ( path_part ) #NEWLINE# #UNINDENT# if ( path_part in ARRAYS ) : #NEWLINE# #INDENT# object_names . append ( path_part ) #NEWLINE# object_names . append ( path_part [ : ( - 1 ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# object_names . append ( 'data' ) #NEWLINE# for path_part in attribute_container_path : #NEWLINE# #INDENT# if ( path_part in OBJECTS ) : #NEWLINE# #INDENT# object_names . append ( path_part ) #NEWLINE# #UNINDENT# if ( path_part in ARRAYS ) : #NEWLINE# #INDENT# object_names . append ( path_part ) #NEWLINE# object_names . append ( path_part [ : ( - 1 ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return tuple ( object_names )