Run the encoder on a dict of values

def encode_keys(self, keys):
        """ Run the encoder on a dict of values """
        return dict(((k, self.encode(v)) for k, v in six.iteritems(keys) if not
                     is_null(v)))