#NEWLINE# def _validate_tag_sets( tag_sets ) : #NEWLINE# #INDENT# 'Validate tag sets for a MongoReplicaSetClient.\n    ' #NEWLINE# if ( tag_sets is None ) : #NEWLINE# #INDENT# return tag_sets #NEWLINE# #UNINDENT# if ( not isinstance ( tag_sets , list ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'Tag sets %r invalid, must be a list' % ( tag_sets , ) ) ) #NEWLINE# #UNINDENT# if ( len ( tag_sets ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Tag sets %r invalid, must be None or contain at least one set of tags' % ( tag_sets , ) ) ) #NEWLINE# #UNINDENT# for tags in tag_sets : #NEWLINE# #INDENT# if ( not isinstance ( tags , Mapping ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'Tag set %r invalid, must be an instance of dict, bson.son.SON or other type that inherits from collection.Mapping' % ( tags , ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return tag_sets