title: itertools group by multiple keys
body: <p>I am using <code>itertools</code> to <code>group by</code> a <code>dictionary key</code> using the below:</p>
  
  <pre><code>host_data = []
  for k,v in itertools.groupby(temp_data, key=lambda x:x['device_id'])
      d = {}
      for dct in v:
          d.update(dct)
      host_data.append(d) 
  </code></pre>
  
  <p>However I would like to group by 'device_id' and 'port_id' if possible, how can I add an additional key to the grouping?</p>