Corrected usage of len(filter(...))

filter() returns an iterable, not a list on Python 3.

Change-Id: I8afb2962bcd193ab67017c98376359c0f28afc66
py33: 'dict_keys' object does not support indexing

In python 3, dict.keys() is a class of 'dict_keys', it does not
support indexing.

Cast the dict to list to get the "first" value of dict, which is
compatible with python 2&3.

Closes-Bug: #1229005

Change-Id: I561b7ada9e5ad936659a657b3161a9b93a15a788
Merge "Corrected usage of len(filter(...))"
Merge "py33: 'dict_keys' object does not support indexing"