Generate Subarrays Of An Array Python Definition