title: How to generate a set of all tuples of given length and sum of elements?
body: <p>I would like to have a function that generates a set (or a list) of all possible tuples with a given length and sum of their elements. The elements of tuples should be not negative integer. </p>
  
  <p>For example for the following input</p>
  
  <pre><code>get_tuple(length=3, total=2)
  </code></pre>
  
  <p>I would like to get the following output:</p>
  
  <pre><code>[(1, 0, 1), (2, 0, 0), (1, 1, 0), (0, 0, 2), (0, 1, 1), (0, 2, 0)]
  </code></pre>
  
  <p>Is the a standard library in Python that can do that? If not, how to write a function that can do it?</p>