def MultiIndicator(pos, size, dtype):
 x = numpy.zeros(size, dtype=dtype)
 if hasattr(pos, '__iter__'):
  for i in pos:
   x[i] = 1
 else:
  x[pos] = 1
 return x

def MultiIndicator ( pos , size , dtype ) : x = numpy . zeros ( size , dtype = dtype ) if hasattr ( pos , '__iter__' ) : for i in pos : x [ i ] = 1 else : x [ pos ] = 1 return x
returns an array of length size and type dtype that is everywhere 0 .