def _accumulate_array_results(self, func, nresults):
        """
        Accumulate array results produced by *func* until they reach
        *nresults* elements.
        """
        res = []
        while len(res) < nresults:
            res += list(func().flat)
        return res[:nresults]

        Accumulate array results produced by *func* until they reach
        *nresults* elements.
        
numba/tests/test_random.py