search for a tuple value in a list of tuples
<p>My datastruture is actually a dictionary that has a integer key and a value that is a list of tuples.
I want to find a particular index in that list.
For example:</p>

<pre><code> d = {}
 d[2] = [(1,-2),(2,4),(3,2)]
 d[1] = [(1,-2),(1,4)]
</code></pre>

<p>I want to find all tuples in a list with index 2 or -2 (they can be in either first or second member of the tuple). Then based on certain conditions I want to remove tuple elements from the list. For example, I want to remove (1,-2) from the  list d[2]. I did not find an efficient way to do this step because I also want to remove (1,-2) from the list d[1] whenever I remove it from d[2]. </p>
