MAINT: ma: clean up ma/test_extras.py: don't use 'import *'; PEP8 whitespace

This commit was cherry-picked from 4a7f27601.
The test for the new 'invert' option of 'in1d' was removed to resolve the conflict.

Conflicts:
	numpy/ma/tests/test_extras.py
BUG: ma: ma.average didn't handle complex arrays correctly (issue gh-2684)
Merge pull request #3441 from WarrenWeckesser/backport-bug-ma-average

Backport the changes to ma.average that fix handling complex arrays.
BUG: field assignment in masked array did not reset mask; closes #2403

The previous behavior when setting a field after indexing to
select an element was suitable for the hard mask case, but
not for the default soft mask.  In addition, the _hardmask
value was not being set at all in the mvoid instance.  With
this changeset, the _hardmask is passed in and __setitem__
takes it into account.

Conflicts:

	numpy/ma/core.py
Merge pull request #3450 from efiring/mvoid_setitem_1.7.x

BUG: field assignment in masked array did not reset mask; closes #2403
BUG: np.ma.compress treated inputs in wrong order; closes #2495
BUG: add __len__ method to ma.mvoid; closes #576
Merge pull request #3452 from efiring/ma_backport_1.7.x

Backport 216d8cb and c2465b6 to 1.7.x
Call to byte_swap_vector should use dst, not d1, because this is
modified by the call to the strided memcpy and will end up pointing
after the end of the destination buffer in that case.
BUG: fix uninitialized-use on invalid sort kind

orign is unset at that point but used in the fail goto,
can probably only be triggered by using the C-api wrong.