#NEWLINE# def _set_data( self , data ) : #NEWLINE# #INDENT# "Stores data for this VertexData. Also sets flags if `data` appears to\n        be in 'movie' or 'raw' format. See __init__ for `data` shape possibilities.\n        " #NEWLINE# if ( data is None ) : #NEWLINE# #INDENT# data = np . zeros ( ( ( self . llen + self . rlen ) , ) ) #NEWLINE# #UNINDENT# self . _data = data #NEWLINE# self . movie = ( self . data . ndim > 1 ) #NEWLINE# self . nverts = self . data . shape [ ( - 1 ) ] #NEWLINE# if ( self . llen == self . nverts ) : #NEWLINE# #INDENT# self . hem = 'left' #NEWLINE# rshape = list ( self . data . shape ) #NEWLINE# rshape [ ( 1 if self . movie else 0 ) ] = self . rlen #NEWLINE# self . _data = np . hstack ( [ self . data , np . zeros ( rshape , dtype = self . data . dtype ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . rlen == self . nverts ) : #NEWLINE# #INDENT# self . hem = 'right' #NEWLINE# lshape = list ( self . data . shape ) #NEWLINE# lshape [ ( 1 if self . movie else 0 ) ] = self . llen #NEWLINE# self . _data = np . hstack ( [ np . zeros ( lshape , dtype = self . data . dtype ) , self . data ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( self . llen + self . rlen ) == self . nverts ) : #NEWLINE# #INDENT# self . hem = 'both' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid number of vertices for subject (given %d, should be %d for left hem, %d for right hem, or %d for both)' % ( self . nverts , self . llen , self . rlen , ( self . llen + self . rlen ) ) ) )