def decode_field(self, field, value):
<EOL>if isinstance(field, messages.BytesField):<EOL><INDENT>try:<EOL><INDENT>padded_value = self.__pad_value(str(value), <NUM_LIT:4>, '<STR_LIT:=>')<EOL>return base64.urlsafe_b64decode(padded_value)<EOL><DEDENT>except (TypeError, UnicodeEncodeError) as err:<EOL><INDENT>raise messages.DecodeError('<STR_LIT>' % err)<EOL><DEDENT><DEDENT>return super(EndpointsProtoJson, self).decode_field(field, value)<EOL>
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.