code: def test_flaky_array_reduction():
      first = {
          (
              "mean_agg-aggregate-10d721567ef5a0d6a0e1afae8a87c066",
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_combine-partial-17c7b5c6eed42e203858b3f6dde16003",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_combine-partial-17c7b5c6eed42e203858b3f6dde16003",
                      1,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-17c7b5c6eed42e203858b3f6dde16003",
              0,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_chunk-98a32cd9f4fadbed908fffb32e0c9679",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-98a32cd9f4fadbed908fffb32e0c9679",
                      1,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-98a32cd9f4fadbed908fffb32e0c9679",
                      2,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-98a32cd9f4fadbed908fffb32e0c9679",
                      3,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-17c7b5c6eed42e203858b3f6dde16003",
              1,
              0,
              0,
              0,
          ): (
              "mean_chunk-mean_combine-partial-17c7b5c6eed42e203858b3f6dde16003",
              1,
              0,
              0,
              0,
          ),
          ("mean_chunk-98a32cd9f4fadbed908fffb32e0c9679", 0, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  0,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  0,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-98a32cd9f4fadbed908fffb32e0c9679", 1, 0, 0, 0): (
              f,
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  1,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  1,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-98a32cd9f4fadbed908fffb32e0c9679", 2, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  2,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  2,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-98a32cd9f4fadbed908fffb32e0c9679", 3, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  3,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  3,
                  0,
                  0,
                  0,
              ),
          ),
          (
              "mean_agg-aggregate-fdb340546b01334890192fcfa55fa0d9",
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_combine-partial-23adb4747560e6e33afd63c5bb179709",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_combine-partial-23adb4747560e6e33afd63c5bb179709",
                      1,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-23adb4747560e6e33afd63c5bb179709",
              0,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_chunk-7edba1c5a284fcec88b9efdda6c2135f",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-7edba1c5a284fcec88b9efdda6c2135f",
                      1,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-7edba1c5a284fcec88b9efdda6c2135f",
                      2,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-7edba1c5a284fcec88b9efdda6c2135f",
                      3,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-23adb4747560e6e33afd63c5bb179709",
              1,
              0,
              0,
              0,
          ): (
              "mean_chunk-mean_combine-partial-23adb4747560e6e33afd63c5bb179709",
              1,
              0,
              0,
              0,
          ),
          ("mean_chunk-7edba1c5a284fcec88b9efdda6c2135f", 0, 0, 0, 0): (
              f,
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  0,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-7edba1c5a284fcec88b9efdda6c2135f", 1, 0, 0, 0): (
              f,
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  1,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-7edba1c5a284fcec88b9efdda6c2135f", 2, 0, 0, 0): (
              f,
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  2,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-7edba1c5a284fcec88b9efdda6c2135f", 3, 0, 0, 0): (
              f,
              (
                  "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                  3,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          (
              "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
              0,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
              1,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
              2,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
              3,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
              4,
              0,
              0,
              0,
          ): (f, 1),
          (
              "mean_agg-aggregate-cc19342c8116d616fc6573f5d20b5762",
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_combine-partial-0c98c5a4517f58f8268985e7464daace",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_combine-partial-0c98c5a4517f58f8268985e7464daace",
                      1,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-0c98c5a4517f58f8268985e7464daace",
              0,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_chunk-540e88b7d9289f6b5461b95a0787af3e",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-540e88b7d9289f6b5461b95a0787af3e",
                      1,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-540e88b7d9289f6b5461b95a0787af3e",
                      2,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-540e88b7d9289f6b5461b95a0787af3e",
                      3,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-0c98c5a4517f58f8268985e7464daace",
              1,
              0,
              0,
              0,
          ): (
              "mean_chunk-mean_combine-partial-0c98c5a4517f58f8268985e7464daace",
              1,
              0,
              0,
              0,
          ),
          ("mean_chunk-540e88b7d9289f6b5461b95a0787af3e", 0, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  0,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-540e88b7d9289f6b5461b95a0787af3e", 1, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  1,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-540e88b7d9289f6b5461b95a0787af3e", 2, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  2,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-540e88b7d9289f6b5461b95a0787af3e", 3, 0, 0, 0): (
              f,
              (
                  "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                  3,
                  0,
                  0,
                  0,
              ),
          ),
          (
              "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
              0,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
              1,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
              2,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
              3,
              0,
              0,
              0,
          ): (f, 1),
          (
              "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
              4,
              0,
              0,
              0,
          ): (f, 1),
          (
              "mean_chunk-mean_combine-partial-17c7b5c6eed42e203858b3f6dde16003",
              1,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      f,
                      (
                          "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                          4,
                          0,
                          0,
                          0,
                      ),
                      (
                          "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                          4,
                          0,
                          0,
                          0,
                      ),
                  )
              ],
          ),
          (
              "mean_chunk-mean_combine-partial-0c98c5a4517f58f8268985e7464daace",
              1,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      f,
                      (
                          "random_sample-e16bcfb15a013023c98a21e2f03d66a9",
                          4,
                          0,
                          0,
                          0,
                      ),
                      2,
                  )
              ],
          ),
          (
              "mean_chunk-mean_combine-partial-23adb4747560e6e33afd63c5bb179709",
              1,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      f,
                      (
                          "random_sample-02eaa4a8dbb23fac4db22ad034c401b3",
                          4,
                          0,
                          0,
                          0,
                      ),
                      2,
                  )
              ],
          ),
      }
  
      other = {
          (
              "mean_agg-aggregate-e79dd3b9757c9fb2ad7ade96f3f6c814",
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_combine-partial-e7d9fd7c132e12007a4b4f62ce443a75",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_combine-partial-e7d9fd7c132e12007a4b4f62ce443a75",
                      1,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-e7d9fd7c132e12007a4b4f62ce443a75",
              0,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_chunk-0df65d9a6e168673f32082f59f19576a",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-0df65d9a6e168673f32082f59f19576a",
                      1,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-0df65d9a6e168673f32082f59f19576a",
                      2,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-0df65d9a6e168673f32082f59f19576a",
                      3,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-e7d9fd7c132e12007a4b4f62ce443a75",
              1,
              0,
              0,
              0,
          ): (
              "mean_chunk-mean_combine-partial-e7d9fd7c132e12007a4b4f62ce443a75",
              1,
              0,
              0,
              0,
          ),
          ("mean_chunk-0df65d9a6e168673f32082f59f19576a", 0, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  0,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  0,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-0df65d9a6e168673f32082f59f19576a", 1, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  1,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  1,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-0df65d9a6e168673f32082f59f19576a", 2, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  2,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  2,
                  0,
                  0,
                  0,
              ),
          ),
          ("mean_chunk-0df65d9a6e168673f32082f59f19576a", 3, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  3,
                  0,
                  0,
                  0,
              ),
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  3,
                  0,
                  0,
                  0,
              ),
          ),
          (
              "mean_agg-aggregate-c7647920facf0e557f947b7a6626b7be",
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_combine-partial-57413f0bb18da78db0f689a096c7fbbf",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_combine-partial-57413f0bb18da78db0f689a096c7fbbf",
                      1,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-57413f0bb18da78db0f689a096c7fbbf",
              0,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7",
                      1,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7",
                      2,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7",
                      3,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-57413f0bb18da78db0f689a096c7fbbf",
              1,
              0,
              0,
              0,
          ): (
              "mean_chunk-mean_combine-partial-57413f0bb18da78db0f689a096c7fbbf",
              1,
              0,
              0,
              0,
          ),
          ("mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7", 0, 0, 0, 0): (
              f,
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  0,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7", 1, 0, 0, 0): (
              f,
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  1,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7", 2, 0, 0, 0): (
              f,
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  2,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-d6bd425ea61739f1eaa71762fe3bbbd7", 3, 0, 0, 0): (
              f,
              (
                  "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                  3,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          (
              "random_sample-241fdbadc062900adc59d1a79c4c41e1",
              0,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-241fdbadc062900adc59d1a79c4c41e1",
              1,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-241fdbadc062900adc59d1a79c4c41e1",
              2,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-241fdbadc062900adc59d1a79c4c41e1",
              3,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-241fdbadc062900adc59d1a79c4c41e1",
              4,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "mean_agg-aggregate-05071ebaabb68a64c180f6f443c5c8f4",
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_combine-partial-a7c475f79a46af4265b189ffdc000bb3",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_combine-partial-a7c475f79a46af4265b189ffdc000bb3",
                      1,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-a7c475f79a46af4265b189ffdc000bb3",
              0,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      "mean_chunk-fd17feaf0728ea7a89d119d3fd172c75",
                      0,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-fd17feaf0728ea7a89d119d3fd172c75",
                      1,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-fd17feaf0728ea7a89d119d3fd172c75",
                      2,
                      0,
                      0,
                      0,
                  ),
                  (
                      "mean_chunk-fd17feaf0728ea7a89d119d3fd172c75",
                      3,
                      0,
                      0,
                      0,
                  ),
              ],
          ),
          (
              "mean_combine-partial-a7c475f79a46af4265b189ffdc000bb3",
              1,
              0,
              0,
              0,
          ): (
              "mean_chunk-mean_combine-partial-a7c475f79a46af4265b189ffdc000bb3",
              1,
              0,
              0,
              0,
          ),
          ("mean_chunk-fd17feaf0728ea7a89d119d3fd172c75", 0, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  0,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-fd17feaf0728ea7a89d119d3fd172c75", 1, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  1,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-fd17feaf0728ea7a89d119d3fd172c75", 2, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  2,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          ("mean_chunk-fd17feaf0728ea7a89d119d3fd172c75", 3, 0, 0, 0): (
              f,
              (
                  "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                  3,
                  0,
                  0,
                  0,
              ),
              2,
          ),
          (
              "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
              0,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
              1,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
              2,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
              3,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
              4,
              0,
              0,
              0,
          ): (
              f,
              "random_sample",
              (10, 1, 987, 1920),
              [],
          ),
          (
              "mean_chunk-mean_combine-partial-a7c475f79a46af4265b189ffdc000bb3",
              1,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      f,
                      (
                          "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                          4,
                          0,
                          0,
                          0,
                      ),
                      2,
                  )
              ],
          ),
          (
              "mean_chunk-mean_combine-partial-e7d9fd7c132e12007a4b4f62ce443a75",
              1,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      f,
                      (
                          "random_sample-a155d5a37ac5e09ede89c98a3bfcadff",
                          4,
                          0,
                          0,
                          0,
                      ),
                      (
                          "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                          4,
                          0,
                          0,
                          0,
                      ),
                  )
              ],
          ),
          (
              "mean_chunk-mean_combine-partial-57413f0bb18da78db0f689a096c7fbbf",
              1,
              0,
              0,
              0,
          ): (
              f,
              [
                  (
                      f,
                      (
                          "random_sample-241fdbadc062900adc59d1a79c4c41e1",
                          4,
                          0,
                          0,
                          0,
                      ),
                      2,
                  )
              ],
          ),
      }
      first_pressure = max(diagnostics(first)[1])
      second_pressure = max(diagnostics(other)[1])
      assert first_pressure == second_pressure
  
imports: from __future__ import annotations
  import inspect
  import pytest
  import dask
  from dask import delayed
  from dask.base import collections_to_dsk, key_split, visualize_dsk
  from dask.core import get_deps
  from dask.order import _connecting_to_roots, diagnostics, ndependencies, order
  from dask.utils_test import add, inc
label_desc: Use image node_id 39 for calling a global function with example usage: test_flaky_array_reduction() without return types