code: def test_fuse_reductions_multiple_input():
      def f(*args):
          return args
  
      d = {"a1": 1, "a2": 2, "b": (f, "a1", "a2"), "c": (f, "b")}
      assert fuse(d, ave_width=2, rename_keys=False) == with_deps(
          {"c": (f, (f, 1, 2))}
      )
      assert fuse(d, ave_width=2, rename_keys=True) == with_deps(
          {"a1-a2-b-c": (f, (f, 1, 2)), "c": "a1-a2-b-c"}
      )
      assert fuse(d, ave_width=1, rename_keys=False) == with_deps(
          {"a1": 1, "a2": 2, "c": (f, (f, "a1", "a2"))}
      )
      assert fuse(d, ave_width=1, rename_keys=True) == with_deps(
          {"a1": 1, "a2": 2, "b-c": (f, (f, "a1", "a2")), "c": "b-c"}
      )
  
      d = {
          "a1": 1,
          "a2": 2,
          "b1": (f, "a1"),
          "b2": (f, "a1", "a2"),
          "b3": (f, "a2"),
          "c": (f, "b1", "b2", "b3"),
      }
      expected = with_deps(d)
      assert fuse(d, ave_width=1, rename_keys=False) == expected
      assert fuse(d, ave_width=2.9, rename_keys=False) == expected
      assert fuse(d, ave_width=1, rename_keys=True) == expected
      assert fuse(d, ave_width=2.9, rename_keys=True) == expected
      assert fuse(d, ave_width=3, rename_keys=False) == with_deps(
          {
              "a1": 1,
              "a2": 2,
              "c": (f, (f, "a1"), (f, "a1", "a2"), (f, "a2")),
          }
      )
      assert fuse(d, ave_width=3, rename_keys=True) == with_deps(
          {
              "a1": 1,
              "a2": 2,
              "b1-b2-b3-c": (f, (f, "a1"), (f, "a1", "a2"), (f, "a2")),
              "c": "b1-b2-b3-c",
          }
      )
  
      d = {
          "a1": 1,
          "a2": 2,
          "b1": (f, "a1"),
          "b2": (f, "a1", "a2"),
          "b3": (f, "a2"),
          "c1": (f, "b1", "b2"),
          "c2": (f, "b2", "b3"),
      }
      assert fuse(d, ave_width=1, rename_keys=False) == with_deps(d)
      assert fuse(d, ave_width=1, rename_keys=True) == with_deps(d)
      assert fuse(d, ave_width=2, rename_keys=False) == with_deps(
          {
              "a1": 1,
              "a2": 2,
              "b2": (f, "a1", "a2"),
              "c1": (f, (f, "a1"), "b2"),
              "c2": (f, "b2", (f, "a2")),
          }
      )
      assert fuse(d, ave_width=2, rename_keys=True) == with_deps(
          {
              "a1": 1,
              "a2": 2,
              "b2": (f, "a1", "a2"),
              "b1-c1": (f, (f, "a1"), "b2"),
              "b3-c2": (f, "b2", (f, "a2")),
              "c1": "b1-c1",
              "c2": "b3-c2",
          }
      )
  
      d = {
          "a1": 1,
          "a2": 2,
          "b1": (f, "a1"),
          "b2": (f, "a1", "a2"),
          "b3": (f, "a2"),
          "c1": (f, "b1", "b2"),
          "c2": (f, "b2", "b3"),
          "d": (f, "c1", "c2"),
      }
      assert fuse(d, ave_width=1, rename_keys=False) == with_deps(d)
      assert fuse(d, ave_width=1, rename_keys=True) == with_deps(d)
  
      # A more aggressive heuristic could do this at `ave_width=2`.  Perhaps
      # we can improve this.  Nevertheless, this is behaving as intended.
      assert fuse(d, ave_width=3, rename_keys=False) == with_deps(
          {
              "a1": 1,
              "a2": 2,
              "b2": (f, "a1", "a2"),
              "d": (f, (f, (f, "a1"), "b2"), (f, "b2", (f, "a2"))),
          }
      )
      assert fuse(d, ave_width=3, rename_keys=True) == with_deps(
          {
              "a1": 1,
              "a2": 2,
              "b2": (f, "a1", "a2"),
              "b1-b3-c1-c2-d": (
                  f,
                  (f, (f, "a1"), "b2"),
                  (f, "b2", (f, "a2")),
              ),
              "d": "b1-b3-c1-c2-d",
          }
      )
  
imports: from __future__ import annotations
  import itertools
  import pickle
  from functools import partial
  import pytest
  import dask
  from dask.base import tokenize
  from dask.core import get_dependencies
  from dask.local import get_sync
  from dask.optimization import SubgraphCallable, cull, functions_of, fuse, fuse_linear, inline, inline_functions
  from dask.utils import apply, partial_by_order
  from dask.utils_test import add, inc
label_desc: Use image node_id 21 for calling a global function with example usage: test_fuse_reductions_multiple_input() and returns: args