Python solution
```     \nrule = {\'type\':0,\'color\':1, \'name\':2}\noutput = 0\nfor i in items:\n\tif i[rule[ruleKey]] == ruleValue:\n\t\toutput += 1\nreturn output
```     \nrule = {\'type\':0,\'color\':1, \'name\':2}\noutput = 0\nfor i in items:\n\tif i[rule[ruleKey]] == ruleValue:\n\t\toutput += 1\nreturn output
['Python']