Human: Python 2.7 Counting number of dictionary items with given value Assistant: 
Here is some code to count the number of pairs in dictionary `d` whose value equal to `chosen_value`

sum(x == chosen_value for x in list(d.values()))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.