bugfix in build_ext: check that ext has an attribute before trying to
use it
Update masked array copy to preserve array order

Using 'K' to try to match array order, fixes https://github.com/numpy/numpy/issues/3156
Adding a test for #3265

Test to ensure that MaskedArray.filled() doesn't change the order of the array.

This test is a little messy because there are problems constructing an F-contiguous masked array in the first place. I had to explicitly pass in F-contiguous arrays for data and mask.
 reduces excess cleverness from 1/2 to 1/3
BUG: np.insert must copy index array

Otherwise it would do in-place changes to it. Fixes gh-3279.
Merge pull request #3280 from seberg/issue-3279

BUG: np.insert must copy index array
Merge pull request #3265 from jamestwebber/patch-2

Update masked array copy to preserve array order
DOC: expanding documentation of index ordering

Trying to separate the ideas of index ordering and memory layout.

As discussed on the mailing list
BUG: sphinxext: fix sphinx extensions broken recently
Merge pull request #3296 from pv/fix-sphinxext

BUG: sphinxext: fix sphinx extensions broken recently
Fix np domain to avoid duplicate module indices in docs
Merge pull request #379 from JonWaltman/doc-fix-duplicate-modindex

DOC: sphinxext: Fix np domain to avoid duplicate module indices in docs
Merge pull request #2822 from ContinuumIO/custom_output_operand_fix

Fix for ufuncs with built in input operands and custom output operands
Merge pull request #3294 from matthew-brett/layout-order-docs

DOC: expanding documentation of index ordering
MAINT: Apply 2to3 idioms fixer.

The idioms fixer makes the following replacements.

1) int <- bool
2) comparison or identity of types <- isinstance
3) a.sort() <- sorted(a)

There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct.  The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.

Closes #3062.
Merge pull request #3281 from charris/2to3-apply-idioms-fixer

MAINT: Apply 2to3 idioms fixer.
Merge pull request #3261 from keflavich/f77_ext_bugfix

bugfix in build_ext: check that ext has an attribute before trying to us it
BUG: gh-3300, Fix missing return value in test_rational.c.src.

Some error returns were returning nothing rather than NULL.

Closes #3300.
Merge pull request #3301 from charris/fix-test_rational

BUG: gh-3300, Fix missing return value in test_rational.c.src.
Add support for structured array ufuncs

- Add New api method PyUFunc_RegisterLoopForStructType for creating new ufunc for structured array
- Add arg_dtypes array to PyUFunc_Loop1d object. This keeps track of each struct dtype that the ufunc can handle.
- Add arg_dtypes parameter to ufunc_loop_matches function so that struct dtypes can be compared for NPY_VOID type num