@staticmethod<EOL><INDENT>def _valid_distaxis(shapes, ax):<DEDENT>
compare_shapes = np.vstack(shapes)<EOL>if ax < compare_shapes.shape[<NUM_LIT:1>]:<EOL><INDENT>compare_shapes[:, ax] = -<NUM_LIT:1><EOL><DEDENT>return np.count_nonzero(compare_shapes - compare_shapes[<NUM_LIT:0>]) == <NUM_LIT:0><EOL>
`ax` is a valid candidate for a distributed axis if the given
        subarray shapes are all the same when ignoring axis `ax`