code: def _flatten_dict(self, dict_):
          
          flattened_dict = {}
          for (key, value) in dict_.iteritems():
              if isinstance(value, dict):
                  flattened_dict.update(self._flatten_dict(value))
              else:
                  flattened_dict[key] = value
          return flattened_dict
docs: Modifies the given dict into a flat dict consisting of only
          key/value pairs.