title: top n keys with highest values in dictionary with tuples as keys
body: <p>I want to get the top n keys of a dictionary with tuples as keys, where the first value of the tuple is a particular number (1 in the example below):</p>
  
  <pre><code>a = {}
  a[1,2] = 3
  a[1,0] =4
  a[1,5] = 1
  a[2,3] = 9
  </code></pre>
  
  <p>I want [1,0] and [1,2] to be returned, where the first element of the tuple/key = 1</p>
  
  <p>this </p>
  
  <pre><code>import heapq
  k = heapq.nlargest(2, a, key=a.get(1,))
  </code></pre>
  
  <p>returns [1,4] and [1,3], the highest keys/tuples with first element = 1, though if I make it </p>
  
  <pre><code>k = heapq.nlargest(2, a, key=a.get(2,))
  </code></pre>
  
  <p>it returns the same thing?</p>