def cmp_structure(llst, rlst, lslices, rslices):
 lshape = slice_shape(llst, lslices)
 rshape = slice_shape(rlst, rslices)
 if (len(lshape) != len(rshape)):
  return (-1)
 for i in range(len(lshape)):
  if (lshape[i] != rshape[i]):
   return (-1)
  if (lshape[i] == 0):
   return 0
 return 0

def cmp_structure ( llst , rlst , lslices , rslices ) : lshape = slice_shape ( llst , lslices ) rshape = slice_shape ( rlst , rslices ) if ( len ( lshape ) != len ( rshape ) ) : return ( - 1 ) for i in range ( len ( lshape ) ) : if ( lshape [ i ] != rshape [ i ] ) : return ( - 1 ) if ( lshape [ i ] == 0 ) : return 0 return 0
compare the structure of llst[lslices] and rlst[rslices] .