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.