#NEWLINE# def get_extras( requested , available ) : #NEWLINE# #INDENT# result = set ( ) #NEWLINE# requested = set ( ( requested or [ ] ) ) #NEWLINE# available = set ( ( available or [ ] ) ) #NEWLINE# if ( '*' in requested ) : #NEWLINE# #INDENT# requested . remove ( '*' ) #NEWLINE# result |= available #NEWLINE# #UNINDENT# for r in requested : #NEWLINE# #INDENT# if ( r == '-' ) : #NEWLINE# #INDENT# result . add ( r ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if r . startswith ( '-' ) : #NEWLINE# #INDENT# unwanted = r [ 1 : ] #NEWLINE# if ( unwanted not in available ) : #NEWLINE# #INDENT# logger . warning ( ( 'undeclared extra: %s' % r ) ) #NEWLINE# #UNINDENT# if ( unwanted in result ) : #NEWLINE# #INDENT# result . remove ( unwanted ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( r not in available ) : #NEWLINE# #INDENT# logger . warning ( ( 'undeclared extra: %s' % r ) ) #NEWLINE# #UNINDENT# result . add ( r ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return result