def equal_axis(*args, **axis):
axis = axis.get("<STR_LIT>", -<NUM_LIT:1>)<EOL>for i, arg in enumerate(args):<EOL><INDENT>if not isinstance(arg, ndarray):<EOL><INDENT>raise ExpectedTypeError(arg, ["<STR_LIT>"])<EOL><DEDENT>if axis >= <NUM_LIT:0> and (axis + <NUM_LIT:1>) < arg.shape[axis]:<EOL><INDENT>raise ShapeMismatchError(arg.shape[axis], axis, [])<EOL><DEDENT>if i >= <NUM_LIT:1> and arg.shape[axis] != args[<NUM_LIT:0>].shape[axis]:<EOL><INDENT>lengths = [a.shape[axis] for a in args]<EOL>raise DifferentLengthError(lengths, arg)<EOL><DEDENT><DEDENT>
Check that elements have the same dimension on specified axis.