code: def to_dict(dictish):
      
      if hasattr(dictish, 'iterkeys'):
          m = dictish.iterkeys
      elif hasattr(dictish, 'keys'):
          m = dictish.keys
      else:
          raise ValueError(dictish)
  
      return dict((k, dictish[k]) for k in m())
docs: Given something that closely resembles a dictionary, we attempt
      to coerce it into a propery dictionary.