def cplus(*args):
n = len(args)<EOL>if   n == <NUM_LIT:0>: return np.asarray(<NUM_LIT:0>)<EOL>elif n == <NUM_LIT:1>: return np.asarray(args[<NUM_LIT:0>])<EOL>elif n >  <NUM_LIT:2>: return reduce(plus, args)<EOL>(a,b) = args<EOL>if sps.issparse(a):<EOL><INDENT>if not sps.issparse(b):<EOL><INDENT>b = np.asarray(b)<EOL>if len(b.shape) == <NUM_LIT:0>: b = np.reshape(b, (<NUM_LIT:1>,<NUM_LIT:1>))<EOL><DEDENT><DEDENT>elif sps.issparse(b):<EOL><INDENT>a = np.asarray(a)<EOL>if len(a.shape) == <NUM_LIT:0>: a = np.reshape(a, (<NUM_LIT:1>,<NUM_LIT:1>))<EOL><DEDENT>else:<EOL><INDENT>a = np.asarray(a)<EOL>b = np.asarray(b)<EOL><DEDENT>return a + b<EOL>
cplus(a, b...) returns the sum of all the values as a numpy array object. Like numpy's add
  function or a+b syntax, plus will thread over the latest dimension possible.

Additionally, cplus works correctly with sparse arrays.