title: Flatten nested dictionaries, compressing keys
body: <p>Suppose you have a dictionary like:</p>
  
  <pre><code>{'a': 1,
   'c': {'a': 2,
         'b': {'x': 5,
               'y' : 10}},
   'd': [1, 2, 3]}
  </code></pre>
  
  <p>How would you go about flattening that into something like:</p>
  
  <pre><code>{'a': 1,
   'c_a': 2,
   'c_b_x': 5,
   'c_b_y': 10,
   'd': [1, 2, 3]}
  </code></pre>