#NEWLINE# def all_patterns( name ) : #NEWLINE# #INDENT# '\n    Accepts a string and returns a pattern of possible patterns involving that name\n    Called by simple_mapping_to_pattern for each name in the mapping it receives.\n    ' #NEWLINE# if ( '.' in name ) : #NEWLINE# #INDENT# ( name , attr ) = name . split ( '.' , 1 ) #NEWLINE# simple_name = ( simple_name_match % name ) #NEWLINE# simple_attr = ( subname_match % attr ) #NEWLINE# dotted_name = ( dotted_name_match % ( simple_name , simple_attr ) ) #NEWLINE# i_from = ( from_import_match % dotted_name ) #NEWLINE# i_from_submod = ( from_import_submod_match % ( simple_name , simple_attr , simple_attr , simple_attr , simple_attr ) ) #NEWLINE# i_name = ( name_import_match % ( dotted_name , dotted_name ) ) #NEWLINE# u_name = ( power_twoname_match % ( simple_name , simple_attr ) ) #NEWLINE# u_subname = ( power_subname_match % simple_attr ) #NEWLINE# return ' | \n' . join ( ( i_name , i_from , i_from_submod , u_name , u_subname ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# simple_name = ( simple_name_match % name ) #NEWLINE# i_name = ( name_import_match % ( simple_name , simple_name ) ) #NEWLINE# i_from = ( from_import_match % simple_name ) #NEWLINE# u_name = ( power_onename_match % simple_name ) #NEWLINE# return ' | \n' . join ( ( i_name , i_from , u_name ) )