#NEWLINE# def _add_dict_cases( self , dct ) : #NEWLINE# #INDENT# length = ( - 1 ) #NEWLINE# if self . _names : #NEWLINE# #INDENT# for name in self . _names : #NEWLINE# #INDENT# if ( name not in dct ) : #NEWLINE# #INDENT# raise KeyError ( ( "'%s' is not a member of the dict" % i ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _names = dct . keys ( ) #NEWLINE# #UNINDENT# self . _split_idx = len ( self . _names ) #NEWLINE# biglist = [ ] #NEWLINE# for key in self . _names : #NEWLINE# #INDENT# val = dct [ key ] #NEWLINE# if ( not isinstance ( key , basestring ) ) : #NEWLINE# #INDENT# raise TypeError ( ( "dictionary key '%s' is not a string" % key ) ) #NEWLINE# #UNINDENT# if ( length < 0 ) : #NEWLINE# #INDENT# length = len ( val ) #NEWLINE# #UNINDENT# if ( length != len ( val ) ) : #NEWLINE# #INDENT# raise ValueError ( ( ( "number of values at key '%s' (%d) differs " % ( key , len ( val ) ) ) + ( 'from number of other values (%d) in CaseSet' % length ) ) ) #NEWLINE# #UNINDENT# biglist . append ( val ) #NEWLINE# #UNINDENT# self . _values = [ ] #NEWLINE# if ( length > 0 ) : #NEWLINE# #INDENT# idxs = range ( len ( self . _names ) ) #NEWLINE# for i in range ( length ) : #NEWLINE# #INDENT# lst = [ biglist [ j ] [ i ] for j in idxs ] #NEWLINE# self . _add_values ( lst )