Transform the for loop to expression

In python 3, if the dict is changed in the loop, there will
be following error:
RuntimeError: dictionary changed size during iteration

Transform the "for loop" to expression to avoid it:
- Use dict() to keep capatibility for old Python version.
- six.iteritems() to avoid the following error:
  ValueError: too many values to unpack

Finally, _code_map contains all the classes that have http_status
attribute.

Close-Bug #1240725

Change-Id: I169b13546bcd0d87353dbca5a9b64229b704fe66