code: public static int numNewAxis(INDArrayIndex... axes) {
          int ret = 0;
          for (INDArrayIndex index : axes)
              if (index instanceof NewAxis)
                  ret++;
          return ret;
      }
docs: Given an array of indexes
  return the number of new axis elements
  in teh array
  @param axes the indexes to get the number
  of new axes for
  @return the number of new axis elements in the given array