def encode_field(self, field, value):
<EOL>if (isinstance(field, messages.IntegerField) and<EOL>field.variant in (messages.Variant.INT64,<EOL>messages.Variant.UINT64,<EOL>messages.Variant.SINT64)):<EOL><INDENT>if value not in (None, [], ()):<EOL><INDENT>if isinstance(value, list):<EOL><INDENT>value = [str(subvalue) for subvalue in value]<EOL><DEDENT>else:<EOL><INDENT>value = str(value)<EOL><DEDENT>return value<EOL><DEDENT><DEDENT>return super(EndpointsProtoJson, self).encode_field(field, value)<EOL>
Encode a python field value to a JSON value.

        Args:
          field: A ProtoRPC field instance.
          value: A python value supported by field.

        Returns:
          A JSON serializable value appropriate for field.