code: def decode_field(self, field, value):
      
      # Override BytesField handling.  Client libraries typically use a url-safe
      # encoding.  b64decode doesn't handle these gracefully.  urlsafe_b64decode
      # handles both cases safely.  Also add padding if the padding is incorrect.
      if isinstance(field, messages.BytesField):
        try:
          # Need to call str(value) because ProtoRPC likes to pass values
          # as unicode, and urlsafe_b64decode can only handle bytes.
          padded_value = self.__pad_value(str(value), 4, '=')
          return base64.urlsafe_b64decode(padded_value)
        except (TypeError, UnicodeEncodeError), err:
          raise messages.DecodeError('Base64 decoding error: %s' % err)
  
      return super(EndpointsProtoJson, self).decode_field(field, value)
docs: Decode a JSON value to a python value.
  
      Args:
        field: A ProtoRPC field instance.
        value: A serialized JSON value.
  
      Returns:
        A Python value compatible with field.