#NEWLINE# def is_subset_of( self , * supersets ) : #NEWLINE# #INDENT# 'Asserts that val is iterable and a subset of the given superset or flattened superset if multiple supersets are given.' #NEWLINE# if ( not isinstance ( self . val , collections . Iterable ) ) : #NEWLINE# #INDENT# raise TypeError ( 'val is not iterable' ) #NEWLINE# #UNINDENT# if ( len ( supersets ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'one or more superset args must be given' ) #NEWLINE# #UNINDENT# superset = [ ] #NEWLINE# for j in supersets : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# for k in j : #NEWLINE# #INDENT# if ( k not in superset ) : #NEWLINE# #INDENT# superset . append ( k ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# if ( j not in superset ) : #NEWLINE# #INDENT# superset . append ( j ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for i in self . val : #NEWLINE# #INDENT# if ( i not in superset ) : #NEWLINE# #INDENT# self . _err ( ( 'Expected <%s> to be subset of %s, but <%s> was missing.' % ( self . val , superset , i ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return self