code: def contract_tuple(chunks, factor):
      """Return simple chunks tuple such that factor divides all elements
  
      Examples
      --------
  
      >>> contract_tuple((2, 2, 8, 4), 4)
      (4, 8, 4)
      """
      assert sum(chunks) % factor == 0
  
      out = []
      residual = 0
      for chunk in chunks:
          chunk += residual
          div = chunk // factor
          residual = chunk % factor
          good = factor * div
          if good:
              out.append(good)
      return tuple(out)
  
file_path: dask/dask/array/reshape.py
imports: from __future__ import annotations
  import math
  import warnings
  from collections import Counter
  from functools import reduce
  from itertools import product
  from operator import mul
  import numpy
  from dask import config
  from dask.array.core import Array, normalize_chunks
  from dask.array.utils import meta_from_array
  from dask.base import tokenize
  from dask.core import flatten
  from dask.highlevelgraph import HighLevelGraph
  from dask.utils import M, parse_bytes
label_desc: Use image node_id 3 for calling a global function with example usage: contract_tuple(chunks, factor) and returns: tuple