<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def equal_axis(*args, **axis):
 """Check that elements have the same dimension on specified axis. """

    axis = axis.get("axis", -1)
    for i, arg in enumerate(args):
        if not isinstance(arg, ndarray):
            raise ExpectedTypeError(arg, ["ndarray"])
        if axis >= 0 and (axis + 1) < arg.shape[axis]:
            raise ShapeMismatchError(arg.shape[axis], axis, [])
        if i >= 1 and arg.shape[axis] != args[0].shape[axis]:
            lengths = [a.shape[axis] for a in args]
            raise DifferentLengthError(lengths, arg)