def argsreduce(cond, *args):
 newargs = np.atleast_1d(*args)
 if (not isinstance(newargs, list)):
  newargs = [newargs]
 expand_arr = (cond == cond)
 return [np.extract(cond, (arr1 * expand_arr)) for arr1 in newargs]

def argsreduce ( cond , * args ) : newargs = np . atleast_1d ( * args ) if ( not isinstance ( newargs , list ) ) : newargs = [ newargs ] expand_arr = ( cond == cond ) return [ np . extract ( cond , ( arr1 * expand_arr ) ) for arr1 in newargs ]
return the sequence of ravel where ravel is true in 1d .