<s> """<STR_LIT>""" <EOL> from . import coretypes as T <EOL> def traverse ( f , t ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( t , T . Mono ) and not isinstance ( t , T . Unit ) : <EOL> return f ( t , [ traverse ( f , p ) for p in t . parameters ] ) <EOL> return t <EOL> def validate ( ds ) : <EOL> """<STR_LIT>""" <EOL> traverse ( _validate , ds ) <EOL> def _validate ( ds , params ) : <EOL> if isinstance ( ds , T . DataShape ) : <EOL> ellipses = [ x for x in ds . parameters if isinstance ( x , T . Ellipsis ) ] <EOL> if len ( ellipses ) > <NUM_LIT:1> : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> elif isinstance ( ds . parameters [ - <NUM_LIT:1> ] , T . Ellipsis ) : <EOL> raise TypeError ( "<STR_LIT>" ) </s>
