Probably best to document what this function does up top in a multiline comment. This isn't usual in numpy, but it is an unfortunate historical accident, not a choice.