code: def fixed_integer_vector_iter(max_vector: Tuple[int, ...], vector_sum: int) -> Iterator[Tuple[int, ...]]:
      
      if vector_sum < 0:
          raise ValueError("Vector sum must not be negative")
      if len(max_vector) == 0:
          if vector_sum == 0:
              yield tuple()
          return
      total = sum(max_vector)
      if vector_sum <= total:
          start = max(max_vector[0] + vector_sum - total, 0)
          end = min(max_vector[0], vector_sum)
          for j in range(start, end + 1):
              for vec in fixed_integer_vector_iter(max_vector[1:], vector_sum - j):
                  yield (j, ) + vec
docs: Return an iterator over the integer vectors which
  
      - are componentwise less than or equal to *max_vector*, and
      - are non-negative, and where
      - the sum of their components is exactly *vector_sum*.
  
      The iterator yields the vectors in lexicographical order.
  
      Examples:
  
          List all vectors that are between ``(0, 0)`` and ``(2, 2)`` componentwise, where the sum of components is 2:
  
          >>> vectors = list(fixed_integer_vector_iter([2, 2], 2))
          >>> vectors
          [(0, 2), (1, 1), (2, 0)]
          >>> list(map(sum, vectors))
          [2, 2, 2]
  
      Args:
          max_vector:
              Maximum vector for the iteration. Every yielded result will be less than or equal to this componentwise.
          vector_sum:
              Every iterated vector will have a component sum equal to this value.
  
      Yields:
          All non-negative vectors that have the given sum and are not larger than the given maximum.
  
      Raises:
          ValueError:
              If *vector_sum* is negative.